Merge pull request #1032 from Garrybest/pr_bundle

copy CRD files and install in case modifying files in repo
This commit is contained in:
karmada-bot 2021-11-26 10:52:04 +08:00 committed by GitHub
commit bc0e618256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -101,9 +101,11 @@ function generate_cert_secret {
# install Karmada's APIs
function installCRDs() {
local crd_path=$1
kubectl apply -f "${REPO_ROOT}/artifacts/deploy/namespace.yaml"
kubectl kustomize "${REPO_ROOT}/charts/_crds" | kubectl apply -f -
kubectl kustomize "${crd_path}"/_crds | kubectl apply -f -
}
# generate cert
@ -197,9 +199,13 @@ then
recover_kubeconfig
exit 1
fi
util::fill_cabundle "${ROOT_CA_FILE}" "${REPO_ROOT}/charts/_crds/patches/webhook_in_resourcebindings.yaml"
util::fill_cabundle "${ROOT_CA_FILE}" "${REPO_ROOT}/charts/_crds/patches/webhook_in_clusterresourcebindings.yaml"
installCRDs
TEMP_PATH_CRDS=$(mktemp -d)
cp -rf "${REPO_ROOT}"/charts/_crds "${TEMP_PATH_CRDS}"
util::fill_cabundle "${ROOT_CA_FILE}" "${TEMP_PATH_CRDS}/_crds/patches/webhook_in_resourcebindings.yaml"
util::fill_cabundle "${ROOT_CA_FILE}" "${TEMP_PATH_CRDS}/_crds/patches/webhook_in_clusterresourcebindings.yaml"
installCRDs "${TEMP_PATH_CRDS}"
rm -rf "${TEMP_PATH_CRDS}"
# deploy webhook configurations on karmada apiserver
util::deploy_webhook_configuration "${ROOT_CA_FILE}" "${REPO_ROOT}/artifacts/deploy/webhook-configuration.yaml"