Skip to content

Commit 897bec6

Browse files
committed
fix failure to pass cni ai id at build time for cni images
1 parent 2245cff commit 897bec6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ cni-image: ## build cni container image.
436436
TARGET=$(OS) \
437437
OS=$(OS) \
438438
ARCH=$(ARCH) \
439-
OS_VERSION=$(OS_VERSION)
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)'
440441

441442
cni-image-push: ## push cni container image.
442443
$(MAKE) container-push \

cni/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ 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
1517
WORKDIR /azure-container-networking
1618
COPY . .
1719
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
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
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
1921
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
2022
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
2123

0 commit comments

Comments
 (0)