mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #49808 from dims/fix-dynamic-admission-control-in-local-cluster
Automatic merge from submit-queue (batch tested with PRs 48365, 49902, 49808, 48722, 47045) Add admission controller API to runtime config and externalize ADMISSION_CONTROL **What this PR does / why we need it**: 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. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # Fixes #47385 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
		@@ -91,6 +91,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'
 | 
			
		||||
@@ -441,6 +442,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}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user