Skip to content

Commit 666c2b0

Browse files
committed
move ai id to hardcoded variable
1 parent 226368e commit 666c2b0

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,9 @@ CNS_BUILD_DIR = $(BUILD_DIR)/cns
7474
NPM_BUILD_DIR = $(BUILD_DIR)/npm
7575
TOOLS_DIR = $(REPO_ROOT)/build/tools
7676
TOOLS_BIN_DIR = $(TOOLS_DIR)/bin
77-
CNI_AI_ID = 5515a1eb-b2bc-406a-98eb-ba462e6f0411
7877
CNS_AI_ID = ce672799-8f08-4235-8c12-08563dc2acef
7978
NPM_AI_ID = 014c22bd-4107-459e-8475-67909e96edcb
8079
ACN_PACKAGE_PATH = github.com/Azure/azure-container-networking
81-
CNI_AI_PATH=$(ACN_PACKAGE_PATH)/telemetry.aiMetadata
8280
CNS_AI_PATH=$(ACN_PACKAGE_PATH)/cns/logger.aiMetadata
8381
NPM_AI_PATH=$(ACN_PACKAGE_PATH)/npm.aiMetadata
8482

@@ -205,15 +203,15 @@ azure-vnet-ipamv6-binary:
205203

206204
# Build the Azure CNI telemetry binary.
207205
azure-vnet-telemetry-binary:
208-
cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION) -X $(CNI_AI_PATH)=$(CNI_AI_ID)" -gcflags="-dwarflocationlists=true"
206+
cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 go build -v -o $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(CNI_VERSION)" -gcflags="-dwarflocationlists=true"
209207

210208
# Build the Azure CLI network binary.
211209
acncli-binary:
212210
cd $(ACNCLI_DIR) && CGO_ENABLED=0 go build -v -o $(ACNCLI_BUILD_DIR)/acn$(EXE_EXT) -ldflags "-X main.version=$(ACN_VERSION)" -gcflags="-dwarflocationlists=true"
213211

214212
# Build the Azure CNS binary.
215213
azure-cns-binary:
216-
cd $(CNS_DIR) && CGO_ENABLED=0 go build -v -o $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) -ldflags "-X main.version=$(CNS_VERSION) -X $(CNS_AI_PATH)=$(CNS_AI_ID) -X $(CNI_AI_PATH)=$(CNI_AI_ID)" -gcflags="-dwarflocationlists=true"
214+
cd $(CNS_DIR) && CGO_ENABLED=0 go build -v -o $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) -ldflags "-X main.version=$(CNS_VERSION) -X $(CNS_AI_PATH)=$(CNS_AI_ID)" -gcflags="-dwarflocationlists=true"
217215

218216
# Build the Azure NPM binary.
219217
azure-npm-binary:
@@ -436,8 +434,7 @@ cni-image: ## build cni container image.
436434
TARGET=$(OS) \
437435
OS=$(OS) \
438436
ARCH=$(ARCH) \
439-
OS_VERSION=$(OS_VERSION) \
440-
EXTRA_BUILD_ARGS='--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)'
437+
OS_VERSION=$(OS_VERSION)
441438

442439
cni-image-push: ## push cni container image.
443440
$(MAKE) container-push \

cni/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core@sha256:a49
1212
FROM go AS azure-vnet
1313
ARG OS
1414
ARG VERSION
15-
ARG CNI_AI_PATH
16-
ARG CNI_AI_ID
1715
WORKDIR /azure-container-networking
1816
COPY . .
1917
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/network/plugin/main.go
20-
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-telemetry -trimpath -ldflags "-X main.version="$VERSION" -X "$CNI_AI_PATH"="$CNI_AI_ID"" -gcflags="-dwarflocationlists=true" cni/telemetry/service/telemetrymain.go
18+
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-telemetry -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/telemetry/service/telemetrymain.go
2119
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-ipam -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/ipam/plugin/main.go
2220
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-stateless -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/network/stateless/main.go
2321

cns/service/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ func main() {
672672
}
673673

674674
if telemetryDaemonEnabled {
675-
logger.Printf("CNI Telemtry is enabled")
675+
logger.Printf("CNI Telemetry is enabled")
676676
go startTelemetryService(rootCtx)
677677
}
678678

telemetry/aiwrapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99
)
1010

1111
var (
12-
aiMetadata string
1312
th aitelemetry.TelemetryHandle
1413
gDisableTrace bool
1514
gDisableMetric bool
1615
ErrTelemetryDisabled = errors.New("telemetry is disabled")
1716
)
1817

1918
const (
19+
aiMetadata = "5515a1eb-b2bc-406a-98eb-ba462e6f0411"
2020
// Wait time for AI to gracefully close AI telemetry session
2121
waitTimeInSecs = 10
2222
)

0 commit comments

Comments
 (0)