Skip to content

Commit ea51e70

Browse files
authored
fix: move version and appinsightsID to a centralized location (internal/buildinfo) (#574)
# Description As title. These will be populated by the Go compiler via the -ldflags during build. Also fixed #530 ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project.
1 parent 792cb27 commit ea51e70

19 files changed

+72
-94
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ retina: ## builds retina binary
176176
retina-binary: ## build the Retina binary
177177
export CGO_ENABLED=0 && \
178178
go generate ./... && \
179-
go build -v -o $(RETINA_BUILD_DIR)/retina$(EXE_EXT) -gcflags="-dwarflocationlists=true" -ldflags "-X main.version=$(TAG) -X main.applicationInsightsID=$(APP_INSIGHTS_ID)" $(RETINA_DIR)/main.go
179+
go build -v -o $(RETINA_BUILD_DIR)/retina$(EXE_EXT) -gcflags="-dwarflocationlists=true" -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version=$(TAG) -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID=$(APP_INSIGHTS_ID)" $(RETINA_DIR)/main.go
180180

181181
retina-capture-workload: ## build the Retina capture workload
182182
cd $(CAPTURE_WORKLOAD_DIR) && CGO_ENABLED=0 go build -v -o $(RETINA_BUILD_DIR)/captureworkload$(EXE_EXT) -gcflags="-dwarflocationlists=true" -ldflags "-X main.version=$(TAG)"

captureworkload/main.go

+8-15
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,33 @@ import (
77

88
"go.uber.org/zap"
99

10+
"github.com/microsoft/retina/internal/buildinfo"
1011
"github.com/microsoft/retina/pkg/capture"
1112
captureConstants "github.com/microsoft/retina/pkg/capture/constants"
1213

1314
"github.com/microsoft/retina/pkg/log"
1415
"github.com/microsoft/retina/pkg/telemetry"
1516
)
1617

17-
var (
18-
// applicationInsightsID is the instrumentation key for Azure Application Insights
19-
// It is set during the build process using the -ldflags flag
20-
// If it is set, the application will send telemetry to the corresponding Application Insights resource.
21-
applicationInsightsID string //nolint
22-
version string //nolint
23-
)
24-
2518
func main() {
2619
lOpts := log.GetDefaultLogOpts()
2720
// Set Azure application insights ID if it is provided
28-
if applicationInsightsID != "" {
29-
lOpts.ApplicationInsightsID = applicationInsightsID
21+
if buildinfo.ApplicationInsightsID != "" {
22+
lOpts.ApplicationInsightsID = buildinfo.ApplicationInsightsID
3023
}
3124

3225
log.SetupZapLogger(lOpts)
3326
l := log.Logger().Named("captureworkload")
3427
l.Info("Start to capture network traffic")
35-
l.Info("Version: ", zap.String("version", version))
28+
l.Info("Version: ", zap.String("version", buildinfo.Version))
3629

3730
var tel telemetry.Telemetry
38-
if applicationInsightsID != "" {
39-
l.Info("telemetry enabled", zap.String("applicationInsightsID", applicationInsightsID))
40-
telemetry.InitAppInsights(applicationInsightsID, version)
31+
if buildinfo.ApplicationInsightsID != "" {
32+
l.Info("telemetry enabled", zap.String("applicationInsightsID", buildinfo.ApplicationInsightsID))
33+
telemetry.InitAppInsights(buildinfo.ApplicationInsightsID, buildinfo.Version)
4134
defer telemetry.ShutdownAppInsights()
4235
tel = telemetry.NewAppInsightsTelemetryClient("retina-capture", map[string]string{
43-
"version": version,
36+
"version": buildinfo.Version,
4437
telemetry.PropertyApiserver: os.Getenv(captureConstants.ApiserverEnvKey),
4538
})
4639
} else {

cmd/hubble/cells_linux.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/cilium/cilium/pkg/pprof"
1414
"github.com/cilium/proxy/pkg/logging"
1515
"github.com/cilium/proxy/pkg/logging/logfields"
16+
"github.com/microsoft/retina/internal/buildinfo"
1617
"github.com/microsoft/retina/pkg/config"
1718
rnode "github.com/microsoft/retina/pkg/controllers/daemon/nodereconciler"
1819
hubbleserver "github.com/microsoft/retina/pkg/hubble"
@@ -59,8 +60,8 @@ var (
5960
return telemetry.Config{
6061
Component: "retina-agent",
6162
EnableTelemetry: cfg.EnableTelemetry,
62-
ApplicationInsightsID: applicationInsightsID,
63-
RetinaVersion: retinaVersion,
63+
ApplicationInsightsID: buildinfo.ApplicationInsightsID,
64+
RetinaVersion: buildinfo.Version,
6465
EnabledPlugins: cfg.EnabledPlugin,
6566
}
6667
}),

cmd/hubble/daemon_main_linux.go

+5-12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/cilium/cilium/pkg/promise"
3333
"github.com/cilium/cilium/pkg/time"
3434
"github.com/cilium/proxy/pkg/logging"
35+
"github.com/microsoft/retina/internal/buildinfo"
3536
"github.com/microsoft/retina/pkg/config"
3637
"github.com/microsoft/retina/pkg/log"
3738
"github.com/microsoft/retina/pkg/managers/pluginmanager"
@@ -51,14 +52,6 @@ const (
5152
logFileName string = "retina.log"
5253
)
5354

54-
var (
55-
// Below two fields are set while building the binary
56-
// they are passed in as ldflags
57-
// see dockerfile
58-
applicationInsightsID string
59-
retinaVersion string
60-
)
61-
6255
func InitGlobalFlags(cmd *cobra.Command, vp *viper.Viper) {
6356
flags := cmd.Flags()
6457

@@ -203,7 +196,7 @@ func newDaemonPromise(params daemonParams) promise.Promise[*Daemon] {
203196
daemon = d
204197
daemonResolver.Resolve(daemon)
205198

206-
d.log.Info("starting Retina Enterprise version: ", retinaVersion)
199+
d.log.Info("starting Retina Enterprise version: ", buildinfo.Version)
207200
err := d.Run(daemonCtx)
208201
if err != nil {
209202
return fmt.Errorf("daemon run failed: %w", err)
@@ -253,12 +246,12 @@ func setupZapLogger(retinaConfig *config.Config, k8sCfg *rest.Config) *log.ZapLo
253246
MaxFileSizeMB: 100, //nolint:gomnd // this is obvious from usage
254247
MaxBackups: 3, //nolint:gomnd // this is obvious from usage
255248
MaxAgeDays: 30, //nolint:gomnd // this is obvious from usage
256-
ApplicationInsightsID: applicationInsightsID,
249+
ApplicationInsightsID: buildinfo.ApplicationInsightsID,
257250
EnableTelemetry: retinaConfig.EnableTelemetry,
258251
}
259252

260253
persistentFields := []zap.Field{
261-
zap.String("version", retinaVersion),
254+
zap.String("version", buildinfo.Version),
262255
zap.String("apiserver", k8sCfg.Host),
263256
zap.Strings("plugins", retinaConfig.EnabledPlugin),
264257
}
@@ -269,7 +262,7 @@ func setupZapLogger(retinaConfig *config.Config, k8sCfg *rest.Config) *log.ZapLo
269262
}
270263

271264
namedLogger := log.Logger().Named("retina-with-hubble")
272-
namedLogger.Info("Traces telemetry initialized with zapai", zap.String("version", retinaVersion), zap.String("appInsightsID", applicationInsightsID))
265+
namedLogger.Info("Traces telemetry initialized with zapai", zap.String("version", buildinfo.Version), zap.String("appInsightsID", buildinfo.ApplicationInsightsID))
273266

274267
return namedLogger
275268
}

cmd/hubble_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"github.com/cilium/cilium/pkg/hive"
99
"github.com/microsoft/retina/cmd/hubble"
10+
"github.com/microsoft/retina/internal/buildinfo"
1011
"github.com/spf13/cobra"
11-
"go.etcd.io/etcd/version"
1212
)
1313

1414
var (
@@ -19,7 +19,7 @@ var (
1919
Short: "Start Hubble control plane",
2020
Run: func(cobraCmd *cobra.Command, _ []string) {
2121
if v, _ := cobraCmd.Flags().GetBool("version"); v {
22-
fmt.Printf("%s %s\n", cobraCmd.Name(), version.Version)
22+
fmt.Printf("%s %s\n", cobraCmd.Name(), buildinfo.Version)
2323
}
2424
hubble.Execute(cobraCmd, h)
2525
},

cmd/legacy/daemon.go

+10-17
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
"github.com/go-logr/zapr"
2727
retinav1alpha1 "github.com/microsoft/retina/crd/api/v1alpha1"
28+
"github.com/microsoft/retina/internal/buildinfo"
2829
"github.com/microsoft/retina/pkg/config"
2930
controllercache "github.com/microsoft/retina/pkg/controllers/cache"
3031
mcc "github.com/microsoft/retina/pkg/controllers/daemon/metricsconfiguration"
@@ -52,15 +53,7 @@ const (
5253
nodeIPEnvKey = "NODE_IP"
5354
)
5455

55-
var (
56-
scheme = k8sruntime.NewScheme()
57-
58-
// applicationInsightsID is the instrumentation key for Azure Application Insights
59-
// It is set during the build process using the -ldflags flag
60-
// If it is set, the application will send telemetry to the corresponding Application Insights resource.
61-
applicationInsightsID string
62-
version string
63-
)
56+
var scheme = k8sruntime.NewScheme()
6457

6558
func init() {
6659
//+kubebuilder:scaffold:scheme
@@ -85,10 +78,10 @@ func NewDaemon(metricsAddr, probeAddr, configFile string, enableLeaderElection b
8578
}
8679

8780
func (d *Daemon) Start() error {
88-
fmt.Printf("starting Retina daemon with legacy control plane %v\n", version)
81+
fmt.Printf("starting Retina daemon with legacy control plane %v\n", buildinfo.Version)
8982

90-
if applicationInsightsID != "" {
91-
telemetry.InitAppInsights(applicationInsightsID, version)
83+
if buildinfo.ApplicationInsightsID != "" {
84+
telemetry.InitAppInsights(buildinfo.ApplicationInsightsID, buildinfo.Version)
9285
defer telemetry.ShutdownAppInsights()
9386
defer telemetry.TrackPanic()
9487
}
@@ -112,10 +105,10 @@ func (d *Daemon) Start() error {
112105
MaxFileSizeMB: 100, //nolint:gomnd // defaults
113106
MaxBackups: 3, //nolint:gomnd // defaults
114107
MaxAgeDays: 30, //nolint:gomnd // defaults
115-
ApplicationInsightsID: applicationInsightsID,
108+
ApplicationInsightsID: buildinfo.ApplicationInsightsID,
116109
EnableTelemetry: daemonConfig.EnableTelemetry,
117110
},
118-
zap.String("version", version),
111+
zap.String("version", buildinfo.Version),
119112
zap.String("apiserver", cfg.Host),
120113
zap.String("plugins", strings.Join(daemonConfig.EnabledPlugin, `,`)),
121114
)
@@ -128,10 +121,10 @@ func (d *Daemon) Start() error {
128121
metrics.InitializeMetrics()
129122

130123
var tel telemetry.Telemetry
131-
if daemonConfig.EnableTelemetry && applicationInsightsID != "" {
132-
mainLogger.Info("telemetry enabled", zap.String("applicationInsightsID", applicationInsightsID))
124+
if daemonConfig.EnableTelemetry && buildinfo.ApplicationInsightsID != "" {
125+
mainLogger.Info("telemetry enabled", zap.String("applicationInsightsID", buildinfo.ApplicationInsightsID))
133126
tel = telemetry.NewAppInsightsTelemetryClient("retina-agent", map[string]string{
134-
"version": version,
127+
"version": buildinfo.Version,
135128
"apiserver": cfg.Host,
136129
"plugins": strings.Join(daemonConfig.EnabledPlugin, `,`),
137130
})

controller/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ENV GOARCH=${GOARCH}
4646
ENV GOOS=${GOOS}
4747
COPY . /go/src/github.com/microsoft/retina
4848
WORKDIR /go/src/github.com/microsoft/retina
49-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/captureworkload -ldflags "-X main.version="$VERSION" -X main.applicationInsightsID="$APP_INSIGHTS_ID"" captureworkload/main.go
49+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/captureworkload -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID="$APP_INSIGHTS_ID"" captureworkload/main.go
5050

5151

5252
# controller binary
@@ -58,7 +58,7 @@ ARG VERSION
5858
ENV CGO_ENABLED=0
5959
ENV GOARCH=${GOARCH}
6060
ENV GOOS=${GOOS}
61-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/controller -ldflags "-X main.version="$VERSION" -X main.applicationInsightsID="$APP_INSIGHTS_ID"" controller/main.go
61+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/controller -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID="$APP_INSIGHTS_ID"" controller/main.go
6262

6363

6464
# init binary
@@ -70,7 +70,7 @@ ARG VERSION
7070
ENV CGO_ENABLED=0
7171
ENV GOARCH=${GOARCH}
7272
ENV GOOS=${GOOS}
73-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/initretina -ldflags "-X main.version="$VERSION" -X main.applicationInsightsID="$APP_INSIGHTS_ID"" init/retina/main_linux.go
73+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /go/bin/retina/initretina -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID="$APP_INSIGHTS_ID"" init/retina/main_linux.go
7474

7575

7676
# tools image

controller/Dockerfile.windows-2019

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WORKDIR /usr/src/retina
1010
# Copy the source
1111
COPY . .
1212

13-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
13+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X "github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
1414
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/
1515

1616
# Copy into final image

controller/Dockerfile.windows-2022

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ WORKDIR /usr/src/retina
99
# Copy the source
1010
COPY . .
1111

12-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
12+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X "github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/
1313
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/
1414

1515
# Copy into final image

controller/Dockerfile.windows-native

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ SHELL ["cmd", "/S", "/C"]
1616
ENV VERSION=$VERSION
1717

1818
ENV APP_INSIGHTS_ID=$APP_INSIGHTS_ID
19-
RUN go build -v -o controller.exe -ldflags="-X main.version=%VERSION% -X main.applicationInsightsID=%APP_INSIGHTS_ID%" .\controller
20-
RUN go build -v -o captureworkload.exe -ldflags="-X main.version=%VERSION% -X main.applicationInsightsID=%APP_INSIGHTS_ID%" .\captureworkload
19+
RUN go build -v -o controller.exe -ldflags="-X github.com/microsoft/retina/internal/buildinfo.Version=%VERSION% -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID=%APP_INSIGHTS_ID%" .\controller
20+
RUN go build -v -o captureworkload.exe -ldflags="-X github.com/microsoft/retina/internal/buildinfo.Version=%VERSION% -X github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID=%APP_INSIGHTS_ID%" .\captureworkload
2121

2222
FROM --platform=windows/amd64 ${BUILDER_IMAGE} as pktmon-builder
2323
WORKDIR C:\\retina

init/retina/main_linux.go

+5-12
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,24 @@
44
package main
55

66
import (
7+
"github.com/microsoft/retina/internal/buildinfo"
78
"github.com/microsoft/retina/pkg/bpf"
89
"github.com/microsoft/retina/pkg/ciliumfs"
910
"github.com/microsoft/retina/pkg/log"
1011
"github.com/microsoft/retina/pkg/telemetry"
1112
"go.uber.org/zap"
1213
)
1314

14-
var (
15-
// applicationInsightsID is the instrumentation key for Azure Application Insights
16-
// It is set during the build process using the -ldflags flag
17-
// If it is set, the application will send telemetry to the corresponding Application Insights resource.
18-
applicationInsightsID string
19-
version string
20-
)
21-
2215
func main() {
2316
// Initialize logger
2417
opts := log.GetDefaultLogOpts()
2518

2619
// Enable telemetry if applicationInsightsID is provided
27-
if applicationInsightsID != "" {
20+
if buildinfo.ApplicationInsightsID != "" {
2821
opts.EnableTelemetry = true
29-
opts.ApplicationInsightsID = applicationInsightsID
22+
opts.ApplicationInsightsID = buildinfo.ApplicationInsightsID
3023
// Initialize application insights
31-
telemetry.InitAppInsights(applicationInsightsID, version)
24+
telemetry.InitAppInsights(buildinfo.ApplicationInsightsID, buildinfo.Version)
3225
defer telemetry.ShutdownAppInsights()
3326
defer telemetry.TrackPanic()
3427
}
@@ -37,7 +30,7 @@ func main() {
3730
if err != nil {
3831
panic(err)
3932
}
40-
l := zl.Named("init-retina").With(zap.String("version", version))
33+
l := zl.Named("init-retina").With(zap.String("version", buildinfo.Version))
4134

4235
// Setup BPF
4336
bpf.Setup(l)

internal/buildinfo/buildinfo.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package buildinfo
2+
3+
// These variables will be populate by the Go compiler via
4+
// the -ldflags, which insert dynamic information
5+
// into the binary at build time
6+
var (
7+
// ApplicationInsightsID is the instrumentation key for Azure Application Insights
8+
// It is set during the build process using the -ldflags flag
9+
// If it is set, the application will send telemetry to the corresponding Application Insights resource.
10+
ApplicationInsightsID string
11+
Version string
12+
)

operator/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ENV GOARCH=${GOARCH}
1616
RUN make manifests
1717
RUN --mount=type=cache,target="/root/.cache/go-build" \
1818
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
19-
-ldflags "-X main.version="$VERSION" \
20-
-X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" \
19+
-ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" \
20+
-X "github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID"="$APP_INSIGHTS_ID"" \
2121
-a -o retina-operator operator/main.go
2222

2323
##################### controller #######################

operator/Dockerfile.windows-2019

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ WORKDIR /usr/src/retina
1111
# Copy the source
1212
COPY . .
1313

14-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go
14+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X "github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go
1515

1616
# Copy into final image
1717
FROM mcr.microsoft.com/windows/nanoserver:ltsc2019

operator/Dockerfile.windows-2022

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ WORKDIR /usr/src/retina
1111
# Copy the source
1212
COPY . .
1313

14-
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go
14+
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X "github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID"="$APP_INSIGHTS_ID"" -o -o /usr/bin/retina-operator.exe retina-operator operator/main.go
1515

1616
# Copy into final image
1717
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

operator/cmd/cilium-crds/cells_linux.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"fmt"
1212
"sync/atomic"
1313

14+
"github.com/microsoft/retina/internal/buildinfo"
1415
"github.com/microsoft/retina/pkg/shared/telemetry"
1516
"github.com/sirupsen/logrus"
1617
k8sruntime "k8s.io/apimachinery/pkg/runtime"
@@ -69,8 +70,8 @@ var (
6970
return telemetry.Config{
7071
Component: "retina-operator",
7172
EnableTelemetry: cfg.EnableTelemetry,
72-
ApplicationInsightsID: applicationInsightsID,
73-
RetinaVersion: retinaVersion,
73+
ApplicationInsightsID: buildinfo.ApplicationInsightsID,
74+
RetinaVersion: buildinfo.Version,
7475
}
7576
}),
7677
telemetry.Constructor,

0 commit comments

Comments
 (0)