Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions azure-ipam/azilium.conflist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"cniVersion": "0.3.1",
"name": "cilium",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to change the name here, otherwise Cilium won't invoke cmdDel from azure-ipam. Pinging @tamilmani1989 and @wedaly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently, the name conflicts with another existing chaining plugin's name, which makes the cmdDel flow returns early

Copy link
Member

@nddq nddq Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@wedaly wedaly Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "cilium" will work, actually -- it's "azure" that was causing problems. The chainingapi.DefaultConfigName in the CNI code is "cilium", so setting name="cilium" tells the CNI to skip chaining (which is what we want).

"plugins": [
{
"type": "cilium-cni",
"ipam": {
"type": "azure-ipam"
},
"enable-debug": true,
"log-file": "/var/log/cilium-cni.log"
}
]
}
13 changes: 12 additions & 1 deletion dropgz/build/cni.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
FROM mcr.microsoft.com/oss/cilium/cilium:v1.12.0 as cilium

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.18 AS azure-ipam
ARG VERSION
WORKDIR /azure-ipam
COPY ./azure-ipam .
RUN CGO_ENABLED=0 go build -a -o bin/azure-ipam -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" .

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.18 AS azure-vnet
ARG VERSION
WORKDIR /azure-container-networking
Expand All @@ -7,8 +15,11 @@ RUN CGO_ENABLED=0 go build -a -o bin/azure-vnet -trimpath -ldflags "-X main.vers
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS compressor
WORKDIR /dropgz
COPY dropgz .
COPY --from=azure-vnet /azure-container-networking/bin/* pkg/embed/fs
COPY --from=azure-ipam /azure-ipam/*.conflist pkg/embed/fs
COPY --from=azure-ipam /azure-ipam/bin/* pkg/embed/fs
COPY --from=azure-vnet /azure-container-networking/cni/*.conflist pkg/embed/fs
COPY --from=azure-vnet /azure-container-networking/bin/* pkg/embed/fs
COPY --from=cilium /opt/cni/bin/cilium-cni pkg/embed/fs
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done

Expand Down