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
{{ message }}
This repository was archived by the owner on Sep 18, 2020. It is now read-only.
kubeconfig=flag.String("kubeconfig", "", "Path to a kubeconfig file. Default to the in-cluster config if not provided.")
21
-
analyticsEnabled=flag.Bool("analytics", true, "Send analytics to Google Analytics")
22
21
autoLabelContainerLinux=flag.Bool("auto-label-container-linux", false, "Auto-label Container Linux nodes with agent=true (convenience)")
23
22
printVersion=flag.Bool("version", false, "Print version and exit")
24
23
// deprecated
25
-
manageAgent=flag.Bool("manage-agent", false, "Manage the associated update-agent")
26
-
agentImageRepo=flag.String("agent-image-repo", "quay.io/coreos/container-linux-update-operator", "The image to use for the managed agent, without version tag")
24
+
analyticsEnabledoptValue
25
+
manageAgent=flag.Bool("manage-agent", false, "Manage the associated update-agent")
26
+
agentImageRepo=flag.String("agent-image-repo", "quay.io/coreos/container-linux-update-operator", "The image to use for the managed agent, without version tag")
27
27
)
28
28
29
29
funcmain() {
30
30
flag.Var(&beforeRebootAnnotations, "before-reboot-annotations", "List of comma-separated Kubernetes node annotations that must be set to 'true' before a reboot is allowed")
31
31
flag.Var(&afterRebootAnnotations, "after-reboot-annotations", "List of comma-separated Kubernetes node annotations that must be set to 'true' before a node is marked schedulable and the operator lock is released")
32
+
flag.Var(&analyticsEnabled, "analytics", "Send analytics to Google Analytics")
32
33
33
34
flag.Set("logtostderr", "true")
34
35
flag.Parse()
@@ -37,6 +38,10 @@ func main() {
37
38
glog.Fatalf("Failed to parse environment variables: %v", err)
38
39
}
39
40
41
+
ifanalyticsEnabled.present {
42
+
glog.Warning("Use of -analytics is deprecated and will be removed. Google Analytics will not be enabled.")
43
+
}
44
+
40
45
// respect KUBECONFIG without the prefix as well
41
46
if*kubeconfig=="" {
42
47
*kubeconfig=os.Getenv("KUBECONFIG")
@@ -47,10 +52,6 @@ func main() {
47
52
os.Exit(0)
48
53
}
49
54
50
-
if*analyticsEnabled {
51
-
analytics.Enable()
52
-
}
53
-
54
55
if*manageAgent {
55
56
glog.Warning("Use of -manage-agent=true is deprecated and will be removed in the future")
56
57
}
@@ -76,8 +77,6 @@ func main() {
76
77
77
78
glog.Infof("%s running", os.Args[0])
78
79
79
-
analytics.ControllerStarted()
80
-
81
80
// Run operator until the stop channel is closed
82
81
stop:=make(chanstruct{})
83
82
deferclose(stop)
@@ -86,3 +85,20 @@ func main() {
86
85
glog.Fatalf("Error while running %s: %v", os.Args[0], err)
87
86
}
88
87
}
88
+
89
+
// optValue is a flag.Value that detects whether a user passed a flag directly.
0 commit comments