mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #28467 from gmarek/addon-manager
Automatic merge from submit-queue Fix the way addon-manager handles non-namespaced objects Fixes #28451 cc @wojtek-t
This commit is contained in:
commit
9fb45943b5
@ -15,7 +15,7 @@
|
||||
IMAGE=gcr.io/google-containers/kube-addon-manager
|
||||
ARCH?=amd64
|
||||
TEMP_DIR:=$(shell mktemp -d)
|
||||
VERSION=v5
|
||||
VERSION=v5.1
|
||||
|
||||
# amd64 and arm has "stable" binaries pushed for v1.2, arm64 and ppc64le hasn't so they have to fetch the latest alpha
|
||||
# however, arm64 and ppc64le are very experimental right now, so it's okay
|
||||
|
@ -41,8 +41,6 @@
|
||||
# 3. kubectl prints the output to stderr (the output should be captured and then
|
||||
# logged)
|
||||
|
||||
|
||||
|
||||
# global config
|
||||
KUBECTL=${TEST_KUBECTL:-} # substitute for tests
|
||||
KUBECTL=${KUBECTL:-${KUBECTL_BIN:-}}
|
||||
@ -133,7 +131,7 @@ try:
|
||||
try:
|
||||
print "%s/%s" % (y["metadata"]["namespace"], y["metadata"]["name"])
|
||||
except Exception, ex:
|
||||
print "default/%s" % y["metadata"]["name"]
|
||||
print "/%s" % y["metadata"]["name"]
|
||||
except Exception, ex:
|
||||
print "ERROR"
|
||||
'''
|
||||
@ -198,7 +196,7 @@ function run-until-success() {
|
||||
# returns a list of <namespace>/<name> pairs (nsnames)
|
||||
function get-addon-nsnames-from-server() {
|
||||
local -r obj_type=$1
|
||||
"${KUBECTL}" get "${obj_type}" --all-namespaces -o go-template="{{range.items}}{{.metadata.namespace}}/{{.metadata.name}} {{end}}" -l kubernetes.io/cluster-service=true
|
||||
"${KUBECTL}" get "${obj_type}" --all-namespaces -o go-template="{{range.items}}{{.metadata.namespace}}/{{.metadata.name}} {{end}}" -l kubernetes.io/cluster-service=true | sed 's/<no value>//g'
|
||||
}
|
||||
|
||||
# returns the characters after the last separator (including)
|
||||
@ -262,7 +260,11 @@ function create-object() {
|
||||
log INFO "Creating new ${obj_type} from file ${file_path} in namespace ${namespace}, name: ${obj_name}"
|
||||
# this will keep on failing if the ${file_path} disappeared in the meantime.
|
||||
# Do not use too many retries.
|
||||
run-until-success "${KUBECTL} create --namespace=${namespace} -f ${file_path}" ${NUM_TRIES} ${DELAY_AFTER_ERROR_SEC}
|
||||
if [[ -n "${namespace}" ]]; then
|
||||
run-until-success "${KUBECTL} create --namespace=${namespace} -f ${file_path}" ${NUM_TRIES} ${DELAY_AFTER_ERROR_SEC}
|
||||
else
|
||||
run-until-success "${KUBECTL} create -f ${file_path}" ${NUM_TRIES} ${DELAY_AFTER_ERROR_SEC}
|
||||
fi
|
||||
}
|
||||
|
||||
function update-object() {
|
||||
|
@ -5,7 +5,6 @@ kind: PersistentVolume
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: influxdb-pv
|
||||
namespace: kube-system
|
||||
labels:
|
||||
kubernetes.io/cluster-service: "true"
|
||||
spec:
|
||||
|
@ -11,7 +11,7 @@
|
||||
"containers": [
|
||||
{
|
||||
"name": "kube-addon-manager",
|
||||
"image": "gcr.io/google-containers/kube-addon-manager-ARCH:v4",
|
||||
"image": "gcr.io/google-containers/kube-addon-manager-ARCH:v5.1",
|
||||
"resources": {
|
||||
"requests": {
|
||||
"cpu": "5m",
|
||||
|
@ -10,7 +10,8 @@ spec:
|
||||
hostNetwork: true
|
||||
containers:
|
||||
- name: kube-addon-manager
|
||||
image: gcr.io/google-containers/kube-addon-manager:v5
|
||||
# When updating version also bump it in cluster/images/hyperkube/static-pods/addon-manager.json
|
||||
image: gcr.io/google-containers/kube-addon-manager:v5.1
|
||||
resources:
|
||||
requests:
|
||||
cpu: 5m
|
||||
|
Loading…
Reference in New Issue
Block a user