Skip to content

Commit 13a8468

Browse files
authored
Constant production analytics write key (#252)
* Static production analytics write key * Make it constant * Needs type * Drop init
1 parent 32abf95 commit 13a8468

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ifdef TAG_NAME
66
endif
77
ENVIRONMENT ?= "development"
88

9-
LD_FLAGS = -s -w -X github.com/k0sproject/k0sctl/version.Environment=$(ENVIRONMENT) -X github.com/k0sproject/k0sctl/integration/segment.WriteKey=$(SEGMENT_WRITE_KEY) -X github.com/k0sproject/k0sctl/version.GitCommit=$(GIT_COMMIT) -X github.com/k0sproject/k0sctl/version.Version=$(K0SCTL_VERSION)
9+
LD_FLAGS = -s -w -X github.com/k0sproject/k0sctl/version.Environment=$(ENVIRONMENT) -X github.com/k0sproject/k0sctl/version.GitCommit=$(GIT_COMMIT) -X github.com/k0sproject/k0sctl/version.Version=$(K0SCTL_VERSION)
1010
BUILD_FLAGS = -trimpath -a -tags "netgo static_build" -installsuffix netgo -ldflags "$(LD_FLAGS) -extldflags '-static'"
1111

1212
bin/k0sctl-linux-x64: $(GO_SRCS)

integration/segment/segment.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package segment
22

33
import (
4-
"os"
54
"runtime"
65

76
"github.com/k0sproject/k0sctl/analytics"
@@ -11,7 +10,7 @@ import (
1110
)
1211

1312
// WriteKey for analytics
14-
var WriteKey = "9uTKgGzXDVsC97cioQWpiV40GwSlXFEl"
13+
const WriteKey string = "oU2iC4shRUBfEboaO0FDuDIUk49Ime92"
1514

1615
// Verbose controls the verbosity of segment analytics client
1716
var Verbose bool
@@ -66,9 +65,3 @@ func (c Client) Publish(event string, props map[string]interface{}) error {
6665
func (c Client) Close() {
6766
c.client.Close()
6867
}
69-
70-
func init() {
71-
if WriteKey == "" {
72-
WriteKey = os.Getenv("SEGMENT_WRITE_KEY")
73-
}
74-
}

0 commit comments

Comments
 (0)