diff --git a/bindata/network/multus/multus.yaml b/bindata/network/multus/multus.yaml index caecef9c14..9cfd5c4e7a 100644 --- a/bindata/network/multus/multus.yaml +++ b/bindata/network/multus/multus.yaml @@ -28,6 +28,25 @@ spec: tolerations: - operator: Exists serviceAccountName: multus + initContainers: + - name: cni-plugins-supported + image: {{.CNIPluginsSupportedImage}} + command: ["/bin/sh"] + args: ["-c", "cp -rf /usr/src/plugins/bin/* /host/opt/cni/bin"] + securityContext: + privileged: true + volumeMounts: + - mountPath: /host/opt/cni/bin + name: cnibin + - name: cni-plugins-unsupported + image: {{.CNIPluginsUnsupportedImage}} + command: ["/bin/sh"] + args: ["-c", "cp -rf /usr/src/plugins/bin/* /host/opt/cni/bin"] + securityContext: + privileged: true + volumeMounts: + - mountPath: /host/opt/cni/bin + name: cnibin containers: - name: kube-multus image: {{.MultusImage}} diff --git a/manifests/0000_07_cluster-network-operator_03_daemonset.yaml b/manifests/0000_07_cluster-network-operator_03_daemonset.yaml index f58947d873..75b5f77932 100644 --- a/manifests/0000_07_cluster-network-operator_03_daemonset.yaml +++ b/manifests/0000_07_cluster-network-operator_03_daemonset.yaml @@ -31,6 +31,10 @@ spec: value: "docker.io/openshift/origin-hypershift:v4.0.0" - name: MULTUS_IMAGE value: "docker.io/nfvpe/multus:snapshot" + - name: CNI_PLUGINS_SUPPORTED_IMAGE + value: "docker.io/nfvpe/container-networking-plugins-supported" + - name: CNI_PLUGINS_UNSUPPORTED_IMAGE + value: "docker.io/nfvpe/container-networking-plugins-unsupported" - name: POD_NAME valueFrom: fieldRef: diff --git a/manifests/image-references b/manifests/image-references index 337f55957b..9819c5148f 100644 --- a/manifests/image-references +++ b/manifests/image-references @@ -18,3 +18,11 @@ spec: from: kind: DockerImage name: quay.io/openshift/origin-multus-cni:v4.0.0 + - name: cni-plugins-supported + from: + kind: DockerImage + name: quay.io/openshift/origin-container-networking-plugins-supported:v4.0.0 + - name: cni-plugins-unsupported + from: + kind: DockerImage + name: quay.io/openshift/origin-container-networking-plugins-unsupported:v4.0.0 diff --git a/pkg/network/multus.go b/pkg/network/multus.go index 0f2f4ce58b..47483d557e 100644 --- a/pkg/network/multus.go +++ b/pkg/network/multus.go @@ -15,6 +15,8 @@ func renderMultusConfig(manifestDir string) ([]*uns.Unstructured, error) { // render the manifests on disk data := render.MakeRenderData() data.Data["MultusImage"] = os.Getenv("MULTUS_IMAGE") + data.Data["CNIPluginsSupportedImage"] = os.Getenv("CNI_PLUGINS_SUPPORTED_IMAGE") + data.Data["CNIPluginsUnsupportedImage"] = os.Getenv("CNI_PLUGINS_UNSUPPORTED_IMAGE") manifests, err := render.RenderDir(filepath.Join(manifestDir, "network/multus"), &data) if err != nil { diff --git a/pkg/network/multus_test.go b/pkg/network/multus_test.go index a5e11175d7..5039b5a468 100644 --- a/pkg/network/multus_test.go +++ b/pkg/network/multus_test.go @@ -6,8 +6,6 @@ import ( netv1 "github.com/openshift/cluster-network-operator/pkg/apis/networkoperator/v1" "github.com/openshift/cluster-network-operator/pkg/apply" - uns "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - . "github.com/onsi/gomega" ) @@ -60,20 +58,6 @@ func TestRenderMultus(t *testing.T) { g.Expect(objs).To(ContainElement(HaveKubernetesID("ClusterRoleBinding", "", "multus"))) g.Expect(objs).To(ContainElement(HaveKubernetesID("DaemonSet", "multus", "multus"))) - // make sure all deployments are in the master - for _, obj := range objs { - if obj.GetKind() != "Deployment" { - continue - } - - sel, found, err := uns.NestedStringMap(obj.Object, "spec", "template", "spec", "nodeSelector") - g.Expect(err).NotTo(HaveOccurred()) - g.Expect(found).To(BeTrue()) - - _, ok := sel["node-role.kubernetes.io/master"] - g.Expect(ok).To(BeTrue()) - } - // Make sure every obj is reasonable: // - it is supported // - it reconciles to itself (steady state)