Merge pull request #91018 from tosi3k/am-whitelist-configuration

Allow overriding the default list of resources of list in addon-manager
This commit is contained in:
Kubernetes Prow Robot 2020-05-15 02:48:11 -07:00 committed by GitHub
commit e6433bd76b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,28 +28,34 @@
KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl} KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl}
KUBECTL_OPTS=${KUBECTL_OPTS:-} KUBECTL_OPTS=${KUBECTL_OPTS:-}
# KUBECTL_PRUNE_WHITELIST is a list of resources whitelisted by # KUBECTL_PRUNE_WHITELIST is a list of resources whitelisted by default.
# default.
# This is currently the same with the default in: # This is currently the same with the default in:
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/apply.go # https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/apply/prune.go.
KUBECTL_PRUNE_WHITELIST=( # To override the default list with other values, set
core/v1/ConfigMap # KUBECTL_PRUNE_WHITELIST_OVERRIDE environment variable to space-separated
core/v1/Endpoints # names of resources to whitelist.
core/v1/Namespace if [ -z "${KUBECTL_PRUNE_WHITELIST_OVERRIDE:-}" ]; then
core/v1/PersistentVolumeClaim KUBECTL_PRUNE_WHITELIST=(
core/v1/PersistentVolume core/v1/ConfigMap
core/v1/Pod core/v1/Endpoints
core/v1/ReplicationController core/v1/Namespace
core/v1/Secret core/v1/PersistentVolumeClaim
core/v1/Service core/v1/PersistentVolume
batch/v1/Job core/v1/Pod
batch/v1beta1/CronJob core/v1/ReplicationController
apps/v1/DaemonSet core/v1/Secret
apps/v1/Deployment core/v1/Service
apps/v1/ReplicaSet batch/v1/Job
apps/v1/StatefulSet batch/v1beta1/CronJob
extensions/v1beta1/Ingress apps/v1/DaemonSet
) apps/v1/Deployment
apps/v1/ReplicaSet
apps/v1/StatefulSet
extensions/v1beta1/Ingress
)
else
read -ra KUBECTL_PRUNE_WHITELIST <<< "${KUBECTL_PRUNE_WHITELIST_OVERRIDE}"
fi
ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC:-60} ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC:-60}
ADDON_PATH=${ADDON_PATH:-/etc/kubernetes/addons} ADDON_PATH=${ADDON_PATH:-/etc/kubernetes/addons}