Created
July 4, 2022 09:38
-
-
Save austincunningham/d863603fc5e55517894dc3a183176499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check the WATCH_NAMESPACE env var to see if populated | |
var watchNamespaceEnvVar = "WATCH_NAMESPACE" | |
watchNamespace, found := os.LookupEnv(watchNamespaceEnvVar) | |
if !found { | |
return "", fmt.Errorf("%s must be set", watchNamespaceEnvVar) | |
} | |
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ | |
Scheme: scheme, | |
MetricsBindAddress: metricsAddr, | |
Port: 9443, | |
LeaderElection: enableLeaderElection, | |
LeaderElectionID: "f1c5ece8.example.com", | |
Namespace: watchNamespace, // namespaced-scope when the value is not an empty string | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment