You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flags.IntVar(&cfg.webhookPort, "webhook-server-port", 9443, "Webhook server port")
137
140
flags.StringVar(&cfg.pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
flags.StringVar(&cfg.cachePath, "cache-path", "/var/cache", "The local directory path used for filesystem based caching")
184
187
flags.StringVar(&cfg.systemNamespace, "system-namespace", "", "Configures the namespace that gets used to deploy system resources.")
185
188
flags.StringVar(&cfg.globalPullSecret, "global-pull-secret", "", "The <namespace>/<name> of the global pull secret that is going to be used to pull bundle images.")
189
+
flags.StringVar(&cfg.kubeconfig, "kubeconfig", "", "Path to kubeconfig file for API server access. Uses in-cluster config if empty.")
186
190
187
191
//adds version sub command
188
192
operatorControllerCmd.AddCommand(versionCommand)
@@ -324,7 +328,18 @@ func run() error {
324
328
"Metrics will not be served since the TLS certificate and key file are not provided.")
325
329
}
326
330
327
-
restConfig:=ctrl.GetConfigOrDie()
331
+
// Load REST config with kubeconfig support for non-default kubeconfig
332
+
varrestConfig*rest.Config
333
+
ifcfg.kubeconfig!="" {
334
+
setupLog.Info("loading kubeconfig from file", "path", cfg.kubeconfig)
0 commit comments