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.
Copy file name to clipboardExpand all lines: cmd/update-operator/main.go
+26-2Lines changed: 26 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ import (
4
4
"flag"
5
5
"fmt"
6
6
"os"
7
+
"strconv"
7
8
8
9
"github.com/coreos/pkg/flagutil"
9
10
"github.com/golang/glog"
@@ -20,13 +21,15 @@ var (
20
21
autoLabelContainerLinux=flag.Bool("auto-label-container-linux", false, "Auto-label Container Linux nodes with agent=true (convenience)")
21
22
printVersion=flag.Bool("version", false, "Print version and exit")
22
23
// deprecated
23
-
manageAgent=flag.Bool("manage-agent", false, "Manage the associated update-agent")
24
-
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")
25
27
)
26
28
27
29
funcmain() {
28
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")
29
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")
30
33
31
34
flag.Set("logtostderr", "true")
32
35
flag.Parse()
@@ -35,6 +38,10 @@ func main() {
35
38
glog.Fatalf("Failed to parse environment variables: %v", err)
36
39
}
37
40
41
+
ifanalyticsEnabled.present {
42
+
glog.Warning("Use of -analytics is deprecated and will be removed. Google Analytics will not be enabled.")
43
+
}
44
+
38
45
// respect KUBECONFIG without the prefix as well
39
46
if*kubeconfig=="" {
40
47
*kubeconfig=os.Getenv("KUBECONFIG")
@@ -78,3 +85,20 @@ func main() {
78
85
glog.Fatalf("Error while running %s: %v", os.Args[0], err)
79
86
}
80
87
}
88
+
89
+
// optValue is a flag.Value that detects whether a user passed a flag directly.
0 commit comments