Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
tremes committed Jul 21, 2021
1 parent 252ef19 commit d639a16
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/cmd/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,32 @@ func runGather(operator *controller.GatherJob, cfg *controllercmd.ControllerComm
}
unstructured, _, _, err := cfg.Config()
if err != nil {
klog.Error(err)
klog.Exit(err)
}
cont, err := config.LoadConfig(operator.Controller, unstructured.Object, config.ToDisconnectedController)
if err != nil {
klog.Error(err)
klog.Exit(err)
}
operator.Controller = cont

var clientConfig *rest.Config
if kubeConfigPath := cmd.Flags().Lookup("kubeconfig").Value.String(); len(kubeConfigPath) > 0 {
kubeConfigBytes, err := ioutil.ReadFile(kubeConfigPath) //nolint: govet
if err != nil {
klog.Error(err)
klog.Exit(err)
}
kubeConfig, err := clientcmd.NewClientConfigFromBytes(kubeConfigBytes)
if err != nil {
klog.Error(err)
klog.Exit(err)
}
clientConfig, err = kubeConfig.ClientConfig()
if err != nil {
klog.Error(err)
klog.Exit(err)
}
} else {
clientConfig, err = rest.InClusterConfig()
if err != nil {
klog.Error(err)
klog.Exit(err)
}
}
protoConfig := rest.CopyConfig(clientConfig)
Expand All @@ -125,17 +125,17 @@ func runOperator(operator *controller.Operator, cfg *controllercmd.ControllerCom
serviceability.StartProfiler()

if configArg := cmd.Flags().Lookup("config").Value.String(); len(configArg) == 0 {
klog.Error("error: --config is required")
klog.Exit("error: --config is required")
}

unstructured, operatorConfig, configBytes, err := cfg.Config()
if err != nil {
klog.Error(err)
klog.Exit(err)
}

startingFileContent, observedFiles, err := cfg.AddDefaultRotationToConfig(operatorConfig, configBytes)
if err != nil {
klog.Error(err)
klog.Exit(err)
}

// if the service CA is rotated, we want to restart
Expand Down

0 comments on commit d639a16

Please sign in to comment.