diff --git a/design/ceph/admission-controller.md b/design/ceph/admission-controller.md index b0f5a6443..76a3a580b 100644 --- a/design/ceph/admission-controller.md +++ b/design/ceph/admission-controller.md @@ -104,7 +104,7 @@ Using the above approach, the dev/admins will have the responsibility of rotatin Below is an excerpt of what a ValidatingWebhookConfig looks like ``` -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: demo-webhook diff --git a/tests/framework/installer/ceph_installer.go b/tests/framework/installer/ceph_installer.go index b58224739..00b558d8d 100644 --- a/tests/framework/installer/ceph_installer.go +++ b/tests/framework/installer/ceph_installer.go @@ -123,7 +123,10 @@ func (h *CephInstaller) CreateCephOperator(namespace string) (err error) { return fmt.Errorf("failed to create namespace %q. %v", namespace, err) } } - if !utils.IsPlatformOpenShift() { + + // disable admission controller for upgrade test as api version v1 require minimum v0.7 controller runtime and upgrade test still using + // older version of controller runtime. + if !utils.IsPlatformOpenShift() && namespace != "upgrade-ns-system" { err = h.startAdmissionController(namespace) if err != nil { return fmt.Errorf("Failed to start admission controllers: %v", err) @@ -515,7 +518,7 @@ func (h *CephInstaller) InstallRook(namespace, storeType string, usePVC bool, st } logger.Infof("installed rook operator and cluster : %s on k8s %s", namespace, h.k8sVersion) - if !utils.IsPlatformOpenShift() && h.k8shelper.VersionAtLeast("v1.15.0") { + if !utils.IsPlatformOpenShift() && h.k8shelper.VersionAtLeast("v1.15.0") && namespace != "upgrade-ns" { if !h.k8shelper.IsPodInExpectedState("rook-ceph-admission-controller", onamespace, "Running") { assert.Fail(h.T(), "admission controller is not running") } diff --git a/tests/scripts/webhook-config.yaml b/tests/scripts/webhook-config.yaml index d20ee39ab..ac4766078 100644 --- a/tests/scripts/webhook-config.yaml +++ b/tests/scripts/webhook-config.yaml @@ -1,4 +1,4 @@ -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: ${WEBHOOK_CONFIG_NAME} @@ -16,7 +16,7 @@ webhooks: namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephcluster caBundle: ${CA_BUNDLE} - admissionReviewVersions: ["v1beta1"] + admissionReviewVersions: ["v1", "v1beta1"] # API server will try to use first version in the list which it supports. sideEffects: None timeoutSeconds: 5 - name: cephblockpool-wh-${SERVICE_NAME}-${NAMESPACE}.rook.io @@ -31,6 +31,6 @@ webhooks: namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephblockpool caBundle: ${CA_BUNDLE} - admissionReviewVersions: ["v1beta1"] + admissionReviewVersions: ["v1", "v1beta1"] # API server will try to use first version in the list which it supports. sideEffects: None timeoutSeconds: 5 diff --git a/tests/scripts/webhook-create-signed-cert.sh b/tests/scripts/webhook-create-signed-cert.sh index e6345a351..f42ddd8d2 100755 --- a/tests/scripts/webhook-create-signed-cert.sh +++ b/tests/scripts/webhook-create-signed-cert.sh @@ -132,4 +132,3 @@ kubectl create secret generic ${secret} \ --from-file=tls.crt=${tmpdir}/server-cert.pem \ --dry-run -o yaml | kubectl -n ${namespace} apply -f - -