Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions cmd/gcp-routes-controller/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"crypto/tls"
"flag"
"fmt"
"net/http"
"net/url"
Expand All @@ -18,7 +17,7 @@ import (
"github.com/golang/glog"
"github.com/spf13/cobra"

"github.com/openshift/machine-config-operator/pkg/version"
"github.com/openshift/machine-config-operator/internal"
)

var (
Expand All @@ -45,11 +44,7 @@ func init() {
}

func runRunCmd(cmd *cobra.Command, args []string) error {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

if runOpts.rootMount != "" {
glog.Infof(`Calling chroot("%s")`, runOpts.rootMount)
Expand Down
4 changes: 0 additions & 4 deletions cmd/gcp-routes-controller/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"

"github.com/openshift/machine-config-operator/pkg/version"
Expand All @@ -22,9 +21,6 @@ func init() {
}

func runVersionCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

program := "GCP Routes Controller"
version := version.Raw + "-" + version.Hash

Expand Down
10 changes: 2 additions & 8 deletions cmd/machine-config-controller/bootstrap.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package main

import (
"flag"

"github.com/golang/glog"
"github.com/spf13/cobra"

"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/pkg/controller/bootstrap"
"github.com/openshift/machine-config-operator/pkg/version"
)

var (
Expand All @@ -33,11 +31,7 @@ func init() {
}

func runbootstrapCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

if bootstrapOpts.manifestsDir == "" || bootstrapOpts.destinationDir == "" {
glog.Fatalf("--dest-dir or --manifest-dir not set")
Expand Down
9 changes: 2 additions & 7 deletions cmd/machine-config-controller/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ package main

import (
"context"
"flag"

"github.com/golang/glog"
"github.com/openshift/machine-config-operator/cmd/common"
"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/internal/clients"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
containerruntimeconfig "github.com/openshift/machine-config-operator/pkg/controller/container-runtime-config"
kubeletconfig "github.com/openshift/machine-config-operator/pkg/controller/kubelet-config"
"github.com/openshift/machine-config-operator/pkg/controller/node"
"github.com/openshift/machine-config-operator/pkg/controller/render"
"github.com/openshift/machine-config-operator/pkg/controller/template"
"github.com/openshift/machine-config-operator/pkg/version"
"github.com/pkg/errors"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -43,11 +42,7 @@ func init() {
}

func runStartCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

cb, err := clients.NewBuilder(startOpts.kubeconfig)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions cmd/machine-config-controller/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"

"github.com/openshift/machine-config-operator/pkg/version"
Expand All @@ -22,9 +21,6 @@ func init() {
}

func runVersionCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

program := "MachineConfigController"
version := version.Raw + "-" + version.Hash

Expand Down
4 changes: 2 additions & 2 deletions cmd/machine-config-daemon/firstboot_complete_machineconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

"github.com/openshift/machine-config-operator/internal"
daemon "github.com/openshift/machine-config-operator/pkg/daemon"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand All @@ -25,8 +26,7 @@ func init() {
}

func runFirstBootCompleteMachineConfig(_ *cobra.Command, _ []string) error {
flag.Set("logtostderr", "true")
flag.Parse()
internal.InitLogging()

exitCh := make(chan error)
defer close(exitCh)
Expand Down
4 changes: 2 additions & 2 deletions cmd/machine-config-daemon/pivot.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
_ "crypto/sha256"

"github.com/golang/glog"
"github.com/openshift/machine-config-operator/internal"
daemon "github.com/openshift/machine-config-operator/pkg/daemon"
"github.com/openshift/machine-config-operator/pkg/daemon/pivot/types"
errors "github.com/pkg/errors"
Expand Down Expand Up @@ -185,8 +186,7 @@ func updateTuningArgs(tuningFilePath, cmdLinePath string) (bool, error) {
}

func run(_ *cobra.Command, args []string) error {
flag.Set("logtostderr", "true")
flag.Parse()
internal.InitLogging()

var container string
if fromEtcPullSpec || len(args) == 0 {
Expand Down
10 changes: 2 additions & 8 deletions cmd/machine-config-daemon/start.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package main

import (
"flag"
"os"
"os/exec"
"path/filepath"
"syscall"

"github.com/golang/glog"
"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/internal/clients"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
"github.com/openshift/machine-config-operator/pkg/daemon"
"github.com/openshift/machine-config-operator/pkg/version"
errors "github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -65,14 +64,9 @@ func bindPodMounts(rootMount string) error {
}

func runStartCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

internal.InitLogging()
glog.V(2).Infof("Options parsed: %+v", startOpts)

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)

onceFromMode := startOpts.onceFrom != ""
if !onceFromMode {
// in the daemon case
Expand Down
4 changes: 0 additions & 4 deletions cmd/machine-config-daemon/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"

"github.com/openshift/machine-config-operator/pkg/version"
Expand All @@ -22,9 +21,6 @@ func init() {
}

func runVersionCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

program := "MachineConfigDaemon"
version := version.Raw + "-" + version.Hash

Expand Down
10 changes: 2 additions & 8 deletions cmd/machine-config-operator/bootstrap.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package main

import (
"flag"

"github.com/golang/glog"
"github.com/spf13/cobra"

"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/pkg/operator"
"github.com/openshift/machine-config-operator/pkg/version"
)

var (
Expand Down Expand Up @@ -86,11 +84,7 @@ func init() {
}

func runBootstrapCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

imgs := operator.Images{
RenderConfigImages: operator.RenderConfigImages{
Expand Down
10 changes: 2 additions & 8 deletions cmd/machine-config-operator/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ package main

import (
"context"
"flag"
"os"

"github.com/golang/glog"
operatorclientset "github.com/openshift/client-go/operator/clientset/versioned"
operatorinformers "github.com/openshift/client-go/operator/informers/externalversions"
operatorv1 "github.com/openshift/client-go/operator/informers/externalversions/operator/v1"
"github.com/openshift/machine-config-operator/cmd/common"
"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/internal/clients"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
"github.com/openshift/machine-config-operator/pkg/operator"
"github.com/openshift/machine-config-operator/pkg/version"
"github.com/spf13/cobra"
"k8s.io/client-go/tools/leaderelection"
)
Expand All @@ -39,11 +37,7 @@ func init() {
}

func runStartCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %s (Raw: %s, Hash: %s)", os.Getenv("RELEASE_VERSION"), version.Raw, version.Hash)
internal.InitLogging()

if startOpts.imagesFile == "" {
glog.Fatal("--images-json cannot be empty")
Expand Down
4 changes: 0 additions & 4 deletions cmd/machine-config-operator/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"

"github.com/openshift/machine-config-operator/pkg/version"
Expand All @@ -22,9 +21,6 @@ func init() {
}

func runVersionCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

program := "MachineConfigOperator"
version := version.Raw + "-" + version.Hash

Expand Down
10 changes: 2 additions & 8 deletions cmd/machine-config-server/bootstrap.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package main

import (
"flag"

"github.com/golang/glog"
"github.com/openshift/machine-config-operator/internal"
"github.com/openshift/machine-config-operator/pkg/server"
"github.com/openshift/machine-config-operator/pkg/version"
"github.com/spf13/cobra"
)

Expand All @@ -30,11 +28,7 @@ func init() {
}

func runBootstrapCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

bs, err := server.NewBootstrapServer(bootstrapOpts.serverBaseDir, bootstrapOpts.serverKubeConfig)

Expand Down
10 changes: 2 additions & 8 deletions cmd/machine-config-server/start.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package main

import (
"flag"

"github.com/golang/glog"
"github.com/openshift/machine-config-operator/internal"
ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common"
"github.com/openshift/machine-config-operator/pkg/server"
"github.com/openshift/machine-config-operator/pkg/version"
"github.com/spf13/cobra"
)

Expand All @@ -31,11 +29,7 @@ func init() {
}

func runStartCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

if startOpts.apiserverURL == "" {
glog.Exitf("--apiserver-url cannot be empty")
Expand Down
4 changes: 0 additions & 4 deletions cmd/machine-config-server/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"flag"
"fmt"

"github.com/openshift/machine-config-operator/pkg/version"
Expand All @@ -22,9 +21,6 @@ func init() {
}

func runVersionCmd(cmd *cobra.Command, args []string) {
flag.Set("logtostderr", "true")
flag.Parse()

program := "MachineConfigServer"
version := version.Raw + "-" + version.Hash

Expand Down
9 changes: 2 additions & 7 deletions cmd/setup-etcd-environment/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"net"
Expand All @@ -17,7 +16,7 @@ import (
"github.com/golang/glog"
"github.com/joho/godotenv"
ceoapi "github.com/openshift/cluster-etcd-operator/pkg/operator/api"
"github.com/openshift/machine-config-operator/pkg/version"
"github.com/openshift/machine-config-operator/internal"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down Expand Up @@ -102,11 +101,7 @@ func newSetupEnv(runOpts *opts, etcdName, etcdDataDir string, ips []string) (*Se
}

func runRunCmd(cmd *cobra.Command, args []string) error {
flag.Set("logtostderr", "true")
flag.Parse()

// To help debugging, immediately log version
glog.Infof("Version: %+v (%s)", version.Raw, version.Hash)
internal.InitLogging()

if runOpts.discoverySRV == "" {
return errors.New("--discovery-srv cannot be empty")
Expand Down
Loading