diff --git a/deploy/kubernetes/base/controller.yaml b/deploy/kubernetes/base/controller.yaml index cdcfa4638..e6408d392 100644 --- a/deploy/kubernetes/base/controller.yaml +++ b/deploy/kubernetes/base/controller.yaml @@ -16,7 +16,7 @@ spec: serviceAccountName: csi-controller-sa containers: - name: csi-provisioner - image: gcr.io/gke-release/csi-provisioner + image: gke.gcr.io/csi-provisioner args: - "--v=5" - "--csi-address=/csi/csi.sock" @@ -25,7 +25,7 @@ spec: - name: socket-dir mountPath: /csi - name: csi-attacher - image: gcr.io/gke-release/csi-attacher + image: gke.gcr.io/csi-attacher args: - "--v=5" - "--csi-address=/csi/csi.sock" @@ -33,7 +33,9 @@ spec: - name: socket-dir mountPath: /csi - name: gce-pd-driver - image: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver + # Don't change base image without changing pdImagePlaceholder in + # test/k8s-integration/main.go + image: gke.gcr.io/gcp-compute-persistent-disk-csi-driver args: - "--v=5" - "--endpoint=unix:/csi/csi.sock" diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index 6f905105c..1436d1311 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: csi-node-sa containers: - name: csi-driver-registrar - image: gcr.io/gke-release/csi-node-driver-registrar + image: gke.gcr.io/csi-node-driver-registrar args: - "--v=5" - "--csi-address=/csi/csi.sock" @@ -37,7 +37,9 @@ spec: - name: gce-pd-driver securityContext: privileged: true - image: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver + # Don't change base image without changing pdImagePlaceholder in + # test/k8s-integration/main.go + image: gke.gcr.io/gcp-compute-persistent-disk-csi-driver args: - "--v=5" - "--endpoint=unix:/csi/csi.sock" diff --git a/deploy/kubernetes/overlays/alpha/controller_add_snapshotter.yaml b/deploy/kubernetes/overlays/alpha/controller_add_snapshotter.yaml index d69809004..bd3f92c4b 100644 --- a/deploy/kubernetes/overlays/alpha/controller_add_snapshotter.yaml +++ b/deploy/kubernetes/overlays/alpha/controller_add_snapshotter.yaml @@ -8,7 +8,7 @@ spec: containers: - name: csi-snapshotter imagePullPolicy: Always - image: gcr.io/gke-release/csi-snapshotter:v1.0.1-gke.0 + image: gke.gcr.io/csi-snapshotter:v1.0.1-gke.0 args: - "--v=5" - "--csi-address=/csi/csi.sock" diff --git a/deploy/kubernetes/overlays/dev/kustomization.yaml b/deploy/kubernetes/overlays/dev/kustomization.yaml index f154c7167..1364c74e3 100644 --- a/deploy/kubernetes/overlays/dev/kustomization.yaml +++ b/deploy/kubernetes/overlays/dev/kustomization.yaml @@ -7,6 +7,6 @@ patches: - node_always_pull.yaml images: # Replace this with your private image names and tags -- name: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver +- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver newName: gcr.io/REPLACEME/gcp-compute-persistent-disk-csi-driver newTag: "latest" diff --git a/deploy/kubernetes/overlays/prow-gke-release-staging-head/kustomization.yaml b/deploy/kubernetes/overlays/prow-gke-release-staging-head/kustomization.yaml index db5d12790..2db9def67 100644 --- a/deploy/kubernetes/overlays/prow-gke-release-staging-head/kustomization.yaml +++ b/deploy/kubernetes/overlays/prow-gke-release-staging-head/kustomization.yaml @@ -3,15 +3,15 @@ kind: Kustomization bases: - ../../base images: -- name: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver +- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver newName: gcr.io/gke-release-staging/gcp-compute-persistent-disk-csi-driver newTag: "latest" -- name: gcr.io/gke-release/csi-provisioner +- name: gke.gcr.io/csi-provisioner newName: gcr.io/gke-release-staging/csi-provisioner newTag: "latest" -- name: gcr.io/gke-release/csi-attacher +- name: gke.gcr.io/csi-attacher newName: gcr.io/gke-release-staging/csi-attacher newTag: "latest" -- name: gcr.io/gke-release/csi-node-driver-registrar +- name: gke.gcr.io/csi-node-driver-registrar newName: gcr.io/gke-release-staging/csi-node-driver-registrar newTag: "latest" diff --git a/deploy/kubernetes/overlays/prow-gke-release-staging-rc/kustomization.yaml b/deploy/kubernetes/overlays/prow-gke-release-staging-rc/kustomization.yaml index bb24c9174..2f56f6c49 100644 --- a/deploy/kubernetes/overlays/prow-gke-release-staging-rc/kustomization.yaml +++ b/deploy/kubernetes/overlays/prow-gke-release-staging-rc/kustomization.yaml @@ -3,15 +3,15 @@ kind: Kustomization bases: - ../../base images: -- name: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver +- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver newName: gcr.io/gke-release-staging/gcp-compute-persistent-disk-csi-driver newTag: "v0.5.0-rc1" -- name: gcr.io/gke-release/csi-provisioner +- name: gke.gcr.io/csi-provisioner newName: gcr.io/gke-release-staging/csi-provisioner newTag: "v1.2.0-gke.0" -- name: gcr.io/gke-release/csi-attacher +- name: gke.gcr.io/csi-attacher newName: gcr.io/gke-release-staging/csi-attacher newTag: "v1.1.0-gke.0" -- name: gcr.io/gke-release/csi-node-driver-registrar +- name: gke.gcr.io/csi-node-driver-registrar newName: gcr.io/gke-release-staging/csi-node-driver-registrar newTag: "v1.1.0-gke.0" diff --git a/deploy/kubernetes/overlays/stable/kustomization.yaml b/deploy/kubernetes/overlays/stable/kustomization.yaml index 2f8d91353..c73c0ebc8 100644 --- a/deploy/kubernetes/overlays/stable/kustomization.yaml +++ b/deploy/kubernetes/overlays/stable/kustomization.yaml @@ -3,15 +3,17 @@ kind: Kustomization bases: - ../../base images: -- name: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver - newName: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver +- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver + # Don't change stable image without changing pdImagePlaceholder in + # test/k8s-integration/main.go + newName: gke.gcr.io/gcp-compute-persistent-disk-csi-driver newTag: "v0.5.0-gke.0" -- name: gcr.io/gke-release/csi-provisioner - newName: gcr.io/gke-release/csi-provisioner +- name: gke.gcr.io/csi-provisioner + newName: gke.gcr.io/csi-provisioner newTag: "v1.2.0-gke.0" -- name: gcr.io/gke-release/csi-attacher - newName: gcr.io/gke-release/csi-attacher +- name: gke.gcr.io/csi-attacher + newName: gke.gcr.io/csi-attacher newTag: "v1.1.0-gke.0" -- name: gcr.io/gke-release/csi-node-driver-registrar - newName: gcr.io/gke-release/csi-node-driver-registrar +- name: gke.gcr.io/csi-node-driver-registrar + newName: gke.gcr.io/csi-node-driver-registrar newTag: "v1.1.0-gke.0" diff --git a/pkg/gce-pd-csi-driver/utils.go b/pkg/gce-pd-csi-driver/utils.go index fbc5061d0..e15fb93db 100644 --- a/pkg/gce-pd-csi-driver/utils.go +++ b/pkg/gce-pd-csi-driver/utils.go @@ -72,31 +72,6 @@ func validateVolumeCapabilities(vcs []*csi.VolumeCapability) error { return err } } - if err := crossValidateAccessModes(vcs); err != nil { - return err - } - return nil -} - -func crossValidateAccessModes(vcs []*csi.VolumeCapability) error { - m := map[csi.VolumeCapability_AccessMode_Mode]bool{} - - for _, vc := range vcs { - m[vc.GetAccessMode().GetMode()] = true - } - - hasWriter := m[csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER] - hasSingleReader := m[csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY] - hasMultiReader := m[csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY] - - if hasWriter && (hasSingleReader || hasMultiReader) { - return fmt.Errorf("both SINGLE_NODE_WRITER and READER_ONLY access mode specified") - } - - if hasSingleReader && hasMultiReader { - return fmt.Errorf("both SINGLE_NODE_READER_ONLY and MULTI_NODE_READY_ONLY specified") - } - return nil } diff --git a/pkg/gce-pd-csi-driver/utils_test.go b/pkg/gce-pd-csi-driver/utils_test.go index f6681e5ac..ab93ef818 100644 --- a/pkg/gce-pd-csi-driver/utils_test.go +++ b/pkg/gce-pd-csi-driver/utils_test.go @@ -140,20 +140,18 @@ func TestValidateVolumeCapabilities(t *testing.T) { expErr: true, }, { - name: "fail with reader + writer capabilities", + name: "success with reader + writer capabilities", vc: []*csi.VolumeCapability{ createVolumeCapability(csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY), createVolumeCapability(csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER), }, - expErr: true, }, { - name: "fail with different reader capabilities", + name: "success with different reader capabilities", vc: []*csi.VolumeCapability{ createVolumeCapability(csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY), createVolumeCapability(csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY), }, - expErr: true, }, } diff --git a/test/k8s-integration/main.go b/test/k8s-integration/main.go index 571a29131..f3836a00a 100644 --- a/test/k8s-integration/main.go +++ b/test/k8s-integration/main.go @@ -57,7 +57,7 @@ var ( ) const ( - pdImagePlaceholder = "gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver" + pdImagePlaceholder = "gke.gcr.io/gcp-compute-persistent-disk-csi-driver" k8sBuildBinDir = "_output/dockerized/bin/linux/amd64" )