Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

Commit e0332c7

Browse files
authored
Merge pull request #144 from coreos/remove-analytics
pkg/analytics: Remove Google Analytics tracking
2 parents 9fd35a7 + 74e5970 commit e0332c7

16 files changed

Lines changed: 28 additions & 1980 deletions

File tree

cmd/update-operator/main.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"flag"
55
"fmt"
66
"os"
7+
"strconv"
78

89
"github.com/coreos/pkg/flagutil"
910
"github.com/golang/glog"
1011

11-
"github.com/coreos/container-linux-update-operator/pkg/analytics"
1212
"github.com/coreos/container-linux-update-operator/pkg/k8sutil"
1313
"github.com/coreos/container-linux-update-operator/pkg/operator"
1414
"github.com/coreos/container-linux-update-operator/pkg/version"
@@ -18,17 +18,18 @@ var (
1818
beforeRebootAnnotations flagutil.StringSliceFlag
1919
afterRebootAnnotations flagutil.StringSliceFlag
2020
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")
2221
autoLabelContainerLinux = flag.Bool("auto-label-container-linux", false, "Auto-label Container Linux nodes with agent=true (convenience)")
2322
printVersion = flag.Bool("version", false, "Print version and exit")
2423
// 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+
analyticsEnabled optValue
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")
2727
)
2828

2929
func main() {
3030
flag.Var(&beforeRebootAnnotations, "before-reboot-annotations", "List of comma-separated Kubernetes node annotations that must be set to 'true' before a reboot is allowed")
3131
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")
3233

3334
flag.Set("logtostderr", "true")
3435
flag.Parse()
@@ -37,6 +38,10 @@ func main() {
3738
glog.Fatalf("Failed to parse environment variables: %v", err)
3839
}
3940

41+
if analyticsEnabled.present {
42+
glog.Warning("Use of -analytics is deprecated and will be removed. Google Analytics will not be enabled.")
43+
}
44+
4045
// respect KUBECONFIG without the prefix as well
4146
if *kubeconfig == "" {
4247
*kubeconfig = os.Getenv("KUBECONFIG")
@@ -47,10 +52,6 @@ func main() {
4752
os.Exit(0)
4853
}
4954

50-
if *analyticsEnabled {
51-
analytics.Enable()
52-
}
53-
5455
if *manageAgent {
5556
glog.Warning("Use of -manage-agent=true is deprecated and will be removed in the future")
5657
}
@@ -76,8 +77,6 @@ func main() {
7677

7778
glog.Infof("%s running", os.Args[0])
7879

79-
analytics.ControllerStarted()
80-
8180
// Run operator until the stop channel is closed
8281
stop := make(chan struct{})
8382
defer close(stop)
@@ -86,3 +85,20 @@ func main() {
8685
glog.Fatalf("Error while running %s: %v", os.Args[0], err)
8786
}
8887
}
88+
89+
// optValue is a flag.Value that detects whether a user passed a flag directly.
90+
type optValue struct {
91+
value bool
92+
present bool
93+
}
94+
95+
func (o *optValue) Set(s string) error {
96+
v, err := strconv.ParseBool(s)
97+
o.value = v
98+
o.present = true
99+
return err
100+
}
101+
102+
func (o *optValue) String() string {
103+
return strconv.FormatBool(o.value)
104+
}

glide.lock

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ import:
5757
version: bf9dde6d0d2c004a008c27aaee91170c786f6db8
5858
- package: github.com/imdario/mergo
5959
version: 6633656539c1639d9d78127b7d47c622b5d7b6dc
60-
- package: github.com/jpillora/go-ogle-analytics
61-
version: 14b04e0594ef6a9fd943363b135656f0ec8c9d0e
6260
- package: github.com/juju/ratelimit
6361
version: 5b9ff866471762aa2ab2dced63c9fb6f53921342
6462
- package: github.com/mailru/easyjson

pkg/analytics/client.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

vendor/github.com/jpillora/go-ogle-analytics/LICENSE

Lines changed: 0 additions & 22 deletions
This file was deleted.

vendor/github.com/jpillora/go-ogle-analytics/client.go

Lines changed: 0 additions & 76 deletions
This file was deleted.

vendor/github.com/jpillora/go-ogle-analytics/conv.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)