Commit 13558335 authored by Davanum Srinivas's avatar Davanum Srinivas

Add admission controller API to config and externalize ADMISSION_CONTROL

Enable the dynamic admission controller registration API by adding "admissionregistration.k8s.io/v1alpha1" to --runtime-config to fix problems when starting up local-up-cluster. Also make sure ADMISSION_CONTROL can be specified externally. Fixes 47385
parent 4a73f19a
......@@ -92,6 +92,7 @@ export KUBE_CACHE_MUTATION_DETECTOR
KUBE_PANIC_WATCH_DECODE_ERROR="${KUBE_PANIC_WATCH_DECODE_ERROR:-true}"
export KUBE_PANIC_WATCH_DECODE_ERROR
ADMISSION_CONTROL=${ADMISSION_CONTROL:-""}
ADMISSION_CONTROL_CONFIG_FILE=${ADMISSION_CONTROL_CONFIG_FILE:-""}
# START_MODE can be 'all', 'kubeletonly', or 'nokubelet'
......@@ -447,6 +448,14 @@ function start_apiserver {
if [[ -n "${ALLOW_PRIVILEGED}" ]]; then
priv_arg="--allow-privileged "
fi
if [[ ${ADMISSION_CONTROL} == *"Initializers"* ]]; then
if [[ -n "${RUNTIME_CONFIG}" ]]; then
RUNTIME_CONFIG+=","
fi
RUNTIME_CONFIG+="admissionregistration.k8s.io/v1alpha1"
fi
runtime_config=""
if [[ -n "${RUNTIME_CONFIG}" ]]; then
runtime_config="--runtime-config=${RUNTIME_CONFIG}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment