From 536a73af644aecc382c5a52122c423ed64210a88 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Wed, 9 Mar 2022 09:11:02 +0530 Subject: [PATCH] core: remove caBundle value from webhook now, we don't require caBundle values to verify in webhook config. Signed-off-by: subhamkrai --- tests/scripts/deploy_admission_controller.sh | 1 - tests/scripts/webhook-config.yaml | 3 --- tests/scripts/webhook-patch-ca-bundle.sh | 15 --------------- 3 files changed, 19 deletions(-) delete mode 100755 tests/scripts/webhook-patch-ca-bundle.sh diff --git a/tests/scripts/deploy_admission_controller.sh b/tests/scripts/deploy_admission_controller.sh index 10970d074..066627436 100755 --- a/tests/scripts/deploy_admission_controller.sh +++ b/tests/scripts/deploy_admission_controller.sh @@ -111,7 +111,6 @@ echo "Successfully created Issuer and Certificate" echo "Deploying webhook config" < "${BASE_DIR}"/webhook-config.yaml \ - "${BASE_DIR}"/webhook-patch-ca-bundle.sh | \ sed -e "s|\${NAMESPACE}|${NAMESPACE}|g" | \ sed -e "s|\${WEBHOOK_CONFIG_NAME}|${WEBHOOK_CONFIG_NAME}|g" | \ sed -e "s|\${SERVICE_NAME}|${SERVICE_NAME}|g" | \ diff --git a/tests/scripts/webhook-config.yaml b/tests/scripts/webhook-config.yaml index f64c9351b..121f8c850 100644 --- a/tests/scripts/webhook-config.yaml +++ b/tests/scripts/webhook-config.yaml @@ -16,7 +16,6 @@ webhooks: name: ${SERVICE_NAME} namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephcluster - caBundle: ${CA_BUNDLE} admissionReviewVersions: ["v1", "v1beta1"] # API server will try to use first version in the list which it supports. sideEffects: None timeoutSeconds: 5 @@ -31,7 +30,6 @@ webhooks: name: ${SERVICE_NAME} namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephblockpool - caBundle: ${CA_BUNDLE} admissionReviewVersions: ["v1", "v1beta1"] # API server will try to use first version in the list which it supports. sideEffects: None timeoutSeconds: 5 @@ -46,7 +44,6 @@ webhooks: name: ${SERVICE_NAME} namespace: ${NAMESPACE} path: /validate-ceph-rook-io-v1-cephobjectstore - caBundle: ${CA_BUNDLE} 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-patch-ca-bundle.sh b/tests/scripts/webhook-patch-ca-bundle.sh deleted file mode 100755 index 4618410e4..000000000 --- a/tests/scripts/webhook-patch-ca-bundle.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Original script found at: https://github.com/morvencao/kube-mutating-webhook-tutorial/blob/master/deployment/webhook-patch-ca-bundle.sh - -set -o errexit -set -o nounset -set -o pipefail - -CA_BUNDLE=$(kubectl get configmap -n kube-system extension-apiserver-authentication -o=jsonpath='{.data.client-ca-file}' | base64 | tr -d '\n') -export CA_BUNDLE - -if command -v envsubst >/dev/null 2>&1; then - envsubst -else - sed -e "s|\${CA_BUNDLE}|${CA_BUNDLE}|g" -fi