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
// podNamespace checks whether the controller is running in a Pod vs.
@@ -92,76 +107,90 @@ func podNamespace() string {
92
107
returnstring(namespace)
93
108
}
94
109
95
-
funcmain() {
96
-
var (
97
-
metricsAddrstring
98
-
certFilestring
99
-
keyFilestring
100
-
enableLeaderElectionbool
101
-
probeAddrstring
102
-
cachePathstring
103
-
operatorControllerVersionbool
104
-
systemNamespacestring
105
-
catalogdCasDirstring
106
-
pullCasDirstring
107
-
globalPullSecretstring
108
-
)
109
-
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8443')")
110
-
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
111
-
flag.StringVar(&catalogdCasDir, "catalogd-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to the Catalogd web service.")
112
-
flag.StringVar(&pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
113
-
flag.StringVar(&certFile, "tls-cert", "", "The certificate file used for the metrics server. Required to enable the metrics server. Requires tls-key.")
114
-
flag.StringVar(&keyFile, "tls-key", "", "The key file used for the metrics server. Required to enable the metrics server. Requires tls-cert")
Short: "Prints version info of operator-controller",
124
+
Run: func(cmd*cobra.Command, args []string) {
125
+
fmt.Println(version.String())
126
+
},
127
+
}
128
+
129
+
funcinit() {
130
+
131
+
//create flagset, the collection of flags for this command
132
+
flags:=operatorControllerCmd.Flags()
133
+
flags.StringVar(&cfg.metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8443')")
134
+
flags.StringVar(&cfg.probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
135
+
flags.StringVar(&cfg.catalogdCasDir, "catalogd-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to the Catalogd web service.")
136
+
flags.StringVar(&cfg.pullCasDir, "pull-cas-dir", "", "The directory of TLS certificate authorities to use for verifying HTTPS connections to image registries.")
137
+
flags.StringVar(&cfg.certFile, "tls-cert", "", "The certificate file used for the metrics server. Required to enable the metrics server. Requires tls-key.")
138
+
flags.StringVar(&cfg.keyFile, "tls-key", "", "The key file used for the metrics server. Required to enable the metrics server. Requires tls-cert")
"Enable leader election for controller manager. "+
117
141
"Enabling this will ensure there is only one active controller manager.")
118
-
flag.StringVar(&cachePath, "cache-path", "/var/cache", "The local directory path used for filesystem based caching")
119
-
flag.BoolVar(&operatorControllerVersion, "version", false, "Prints operator-controller version information")
120
-
flag.StringVar(&systemNamespace, "system-namespace", "", "Configures the namespace that gets used to deploy system resources.")
121
-
flag.StringVar(&globalPullSecret, "global-pull-secret", "", "The <namespace>/<name> of the global pull secret that is going to be used to pull bundle images.")
142
+
flags.StringVar(&cfg.cachePath, "cache-path", "/var/cache", "The local directory path used for filesystem based caching")
143
+
flags.BoolVar(&cfg.operatorControllerVersion, "version", false, "Prints operator-controller version information")
144
+
flags.StringVar(&cfg.systemNamespace, "system-namespace", "", "Configures the namespace that gets used to deploy system resources.")
145
+
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.")
0 commit comments