10 Commits
v3.9 ... v3.9.3

Author SHA1 Message Date
Yury K
80c0f6f0c4 Update network-attachment-definition-client for multus v3 (#996)
Update network-attachment-definition-client package
to support DeviceInfo spec 1.1.0

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
2022-12-26 16:03:21 +09:00
Doug Smith
991a1b2c7f Merge pull request #924 from k8snetworkplumbingwg/fix/image
Fix release 3.x thick image tag to isolate from 4.0
2022-10-11 13:44:19 -04:00
Tomofumi Hayashi
e9b87fb05a Fix release 3.x thick image tag to isolate from 4.0
Due to #900, image tag, ':thick', which is used in 4.0 and 3.x,
gets user confused because thick image is not compatible between
4.0 and 3.x. This fix provides strict version name in deployment
yaml to specify install image tag.
2022-10-12 01:31:15 +09:00
Doug Smith
25703fce21 Change container image to fedora from centos (#904)
This change introduce fedora container for multus image.

Co-authored-by: Tomofumi Hayashi <tohayash@redhat.com>
2022-08-27 16:09:54 +09:00
Doug Smith
6b38a213b1 Merge pull request #905 from s1061123/fix/revive
Fix revive in CI
2022-08-26 15:09:16 -04:00
Tomofumi Hayashi
2068ea9f77 Fix revive in CI 2022-08-27 04:03:58 +09:00
Doug Smith
f4c0adf54c Merge pull request #881 from chrisplo/detect-python3
Detect python3
2022-07-22 09:48:40 -04:00
Chris Plock
ac6757b9cc Detect python3
fixes https://github.com/k8snetworkplumbingwg/multus-cni/issues/880
2022-07-15 15:13:27 -07:00
Doug Smith
70c970cd6e Merge pull request #878 from tomkukral/print-kubeconfig
write output file for generated kubeconfig
2022-07-12 08:39:17 -04:00
Tomáš Kukrál
95adff55b0 write output file for generated kubeconfig
This change will make debugging easier in cases when non-default
location is used and user forgot to mount new directory.
2022-07-08 14:02:51 +02:00
15 changed files with 34 additions and 37 deletions

View File

@@ -47,7 +47,7 @@ jobs:
context: . context: .
push: true push: true
tags: | tags: |
ghcr.io/${{ github.repository }}:thick-amd64 ghcr.io/${{ github.repository }}:stable-thick-amd64
${{ steps.docker_meta.outputs.tags }}-thick-amd64 ${{ steps.docker_meta.outputs.tags }}-thick-amd64
file: images/Dockerfile.thick file: images/Dockerfile.thick

View File

@@ -16,11 +16,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Run Revive - name: Run Revive Action by pulling pre-built image
run: | uses: docker://morphy/revive-action:v2
GO111MODULE=off go get github.com/mgechev/revive with:
$(go env GOPATH)/bin/revive -exclude ./vendor/... ./... # this is ouput for user exclude: "./vendor/..."
$(go env GOPATH)/bin/revive -exclude ./vendor/... ./...| xargs -0 -r false # this is for github actions
- name: Run go fmt - name: Run go fmt
run: go fmt ./... run: go fmt ./...

View File

@@ -124,7 +124,7 @@ contexts:
current-context: multus-context current-context: multus-context
` `
kubeconfig := fmt.Sprintf(kubeConfigTemplate, protocol, k8sServiceIP, k8sServicePort, tlsConfig, serviceAccountToken) kubeconfig := fmt.Sprintf(kubeConfigTemplate, protocol, k8sServiceIP, k8sServicePort, tlsConfig, serviceAccountToken)
logInfo("Generated KubeConfig: \n%s", kubeconfig) logInfo("Generated KubeConfig saved to %s: \n%s", outputPath, kubeconfig)
return ioutil.WriteFile(outputPath, []byte(kubeconfig), userRWPermission) return ioutil.WriteFile(outputPath, []byte(kubeconfig), userRWPermission)
} }

View File

@@ -122,7 +122,7 @@ spec:
serviceAccountName: multus serviceAccountName: multus
containers: containers:
- name: kube-multus - name: kube-multus
image: ghcr.io/k8snetworkplumbingwg/multus-cni:thick image: ghcr.io/k8snetworkplumbingwg/multus-cni:v3.9.2-thick-amd64
command: [ "/usr/src/multus-cni/bin/multus-daemon" ] command: [ "/usr/src/multus-cni/bin/multus-daemon" ]
args: args:
- "-cni-version=0.3.1" - "-cni-version=0.3.1"
@@ -146,7 +146,7 @@ spec:
mountPath: /host/opt/cni/bin mountPath: /host/opt/cni/bin
initContainers: initContainers:
- name: install-multus-binary - name: install-multus-binary
image: ghcr.io/k8snetworkplumbingwg/multus-cni:thick image: ghcr.io/k8snetworkplumbingwg/multus-cni:v3.9.2-thick-amd64
command: command:
- "cp" - "cp"
- "/usr/src/multus-cni/bin/multus" - "/usr/src/multus-cni/bin/multus"
@@ -162,7 +162,7 @@ spec:
mountPath: /host/opt/cni/bin mountPath: /host/opt/cni/bin
mountPropagation: Bidirectional mountPropagation: Bidirectional
- name: generate-kubeconfig - name: generate-kubeconfig
image: ghcr.io/k8snetworkplumbingwg/multus-cni:thick image: ghcr.io/k8snetworkplumbingwg/multus-cni:v3.9.2-thick-amd64
command: command:
- "/usr/src/multus-cni/bin/generate-kubeconfig" - "/usr/src/multus-cni/bin/generate-kubeconfig"
args: args:

2
go.mod
View File

@@ -7,7 +7,7 @@ require (
github.com/containernetworking/cni v0.8.1 github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.9.1 github.com/containernetworking/plugins v0.9.1
github.com/fsnotify/fsnotify v1.4.9 github.com/fsnotify/fsnotify v1.4.9
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20220511184442-64cfb249bdbe github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20221215110210-ad3f3381681f
github.com/onsi/ginkgo v1.12.1 github.com/onsi/ginkgo v1.12.1
github.com/onsi/gomega v1.10.3 github.com/onsi/gomega v1.10.3
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1

4
go.sum
View File

@@ -363,8 +363,8 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20220511184442-64cfb249bdbe h1:VPiaEz+bUnFjUBBz3NnvmXbOtTs5Vpyzrsx9hcp/caM= github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20221215110210-ad3f3381681f h1:SVJhARCyy2mmDUegdEBnYyLqjB4h6BxsfN5rfehExuU=
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20220511184442-64cfb249bdbe/go.mod h1:+1DpV8uIwteAhxNO0lgRox8gHkTG6w3OeDfAlg+qqjA= github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20221215110210-ad3f3381681f/go.mod h1:+1DpV8uIwteAhxNO0lgRox8gHkTG6w3OeDfAlg+qqjA=
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=

View File

@@ -7,7 +7,7 @@ ADD . /usr/src/multus-cni
RUN cd /usr/src/multus-cni && \ RUN cd /usr/src/multus-cni && \
./hack/build-go.sh ./hack/build-go.sh
FROM centos:centos7 FROM python:slim
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

View File

@@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \
./hack/build-go.sh ./hack/build-go.sh
# build arm container # build arm container
FROM arm32v7/centos:7 FROM arm32v7/python:slim
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

View File

@@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \
./hack/build-go.sh ./hack/build-go.sh
# build arm64 container # build arm64 container
FROM arm64v8/centos:7 FROM arm64v8/python:slim
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

View File

@@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \
./hack/build-go.sh ./hack/build-go.sh
# build ppc container # build ppc container
FROM ppc64le/centos:latest FROM ppc64le/python:slim
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

View File

@@ -11,7 +11,7 @@ RUN cd /usr/src/multus-cni && \
./hack/build-go.sh ./hack/build-go.sh
# build s390x container # build s390x container
FROM s390x/python:3-slim FROM s390x/python:slim
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

View File

@@ -7,7 +7,7 @@ ADD . /usr/src/multus-cni
RUN cd /usr/src/multus-cni && \ RUN cd /usr/src/multus-cni && \
./hack/build-go.sh ./hack/build-go.sh
FROM registry.access.redhat.com/ubi8/ubi-minimal FROM debian:stable-slim
LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni LABEL org.opencontainers.image.source https://github.com/k8snetworkplumbingwg/multus-cni
COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin COPY --from=build /usr/src/multus-cni/bin /usr/src/multus-cni/bin
COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE COPY --from=build /usr/src/multus-cni/LICENSE /usr/src/multus-cni/LICENSE

View File

@@ -83,10 +83,6 @@ function warn()
log "WARN: {$1}" log "WARN: {$1}"
} }
if ! type python3 &> /dev/null; then
alias python=python3
fi
function checkCniVersion { function checkCniVersion {
cniversion_python_tmpfile=$(mktemp) cniversion_python_tmpfile=$(mktemp)
cat << EOF > $cniversion_python_tmpfile cat << EOF > $cniversion_python_tmpfile
@@ -103,7 +99,7 @@ if version(v_top_level) >= v_040 and version(v_nested) < v_040:
msg = "Multus cni version is %s while master plugin cni version is %s" msg = "Multus cni version is %s while master plugin cni version is %s"
print(msg % (v_top_level, v_nested)) print(msg % (v_top_level, v_nested))
EOF EOF
python $cniversion_python_tmpfile $1 $2 python3 $cniversion_python_tmpfile $1 $2
} }
# Parse parameters given as arguments to this script. # Parse parameters given as arguments to this script.
@@ -364,7 +360,7 @@ if [ "$MULTUS_CONF_FILE" == "auto" ]; then
if [ "$OVERRIDE_NETWORK_NAME" == "true" ]; then if [ "$OVERRIDE_NETWORK_NAME" == "true" ]; then
MASTER_PLUGIN_NET_NAME="$(cat $MULTUS_AUTOCONF_DIR/$MASTER_PLUGIN | \ MASTER_PLUGIN_NET_NAME="$(cat $MULTUS_AUTOCONF_DIR/$MASTER_PLUGIN | \
python -c 'import json,sys;print(json.load(sys.stdin)["name"])')" python3 -c 'import json,sys;print(json.load(sys.stdin)["name"])')"
else else
MASTER_PLUGIN_NET_NAME="multus-cni-network" MASTER_PLUGIN_NET_NAME="multus-cni-network"
fi fi
@@ -386,7 +382,7 @@ else:
EOF EOF
NESTED_CAPABILITIES_STRING="$(cat $MULTUS_AUTOCONF_DIR/$MASTER_PLUGIN | \ NESTED_CAPABILITIES_STRING="$(cat $MULTUS_AUTOCONF_DIR/$MASTER_PLUGIN | \
python $capabilities_python_filter_tmpfile)" python3 $capabilities_python_filter_tmpfile)"
rm $capabilities_python_filter_tmpfile rm $capabilities_python_filter_tmpfile
log "Nested capabilities string: $NESTED_CAPABILITIES_STRING" log "Nested capabilities string: $NESTED_CAPABILITIES_STRING"

View File

@@ -43,7 +43,7 @@ const (
DeviceInfoTypeVHostUser = "vhost-user" DeviceInfoTypeVHostUser = "vhost-user"
DeviceInfoTypeMemif = "memif" DeviceInfoTypeMemif = "memif"
DeviceInfoTypeVDPA = "vdpa" DeviceInfoTypeVDPA = "vdpa"
DeviceInfoVersion = "1.0.0" DeviceInfoVersion = "1.1.0"
) )
// DeviceInfo contains the information of the device associated // DeviceInfo contains the information of the device associated
@@ -58,18 +58,20 @@ type DeviceInfo struct {
} }
type PciDevice struct { type PciDevice struct {
PciAddress string `json:"pci-address,omitempty"` PciAddress string `json:"pci-address,omitempty"`
Vhostnet string `json:"vhost-net,omitempty"` Vhostnet string `json:"vhost-net,omitempty"`
RdmaDevice string `json:"rdma-device,omitempty"` RdmaDevice string `json:"rdma-device,omitempty"`
PfPciAddress string `json:"pf-pci-address,omitempty"` PfPciAddress string `json:"pf-pci-address,omitempty"`
RepresentorDevice string `json:"representor-device,omitempty"`
} }
type VdpaDevice struct { type VdpaDevice struct {
ParentDevice string `json:"parent-device,omitempty"` ParentDevice string `json:"parent-device,omitempty"`
Driver string `json:"driver,omitempty"` Driver string `json:"driver,omitempty"`
Path string `json:"path,omitempty"` Path string `json:"path,omitempty"`
PciAddress string `json:"pci-address,omitempty"` PciAddress string `json:"pci-address,omitempty"`
PfPciAddress string `json:"pf-pci-address,omitempty"` PfPciAddress string `json:"pf-pci-address,omitempty"`
RepresentorDevice string `json:"representor-device,omitempty"`
} }
const ( const (

2
vendor/modules.txt vendored
View File

@@ -54,7 +54,7 @@ github.com/googleapis/gnostic/openapiv2
github.com/imdario/mergo github.com/imdario/mergo
# github.com/json-iterator/go v1.1.10 # github.com/json-iterator/go v1.1.10
github.com/json-iterator/go github.com/json-iterator/go
# github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20220511184442-64cfb249bdbe # github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.1.2-0.20221215110210-ad3f3381681f
## explicit ## explicit
github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io
github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1 github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1