mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 19:21:37 +00:00
Test jobs/hpas in storage update
This commit is contained in:
@@ -46,6 +46,8 @@ declare -a resources=(
|
||||
"resourcequotas"
|
||||
"secrets"
|
||||
"services"
|
||||
"jobs"
|
||||
"horizontalpodautoscalers"
|
||||
)
|
||||
|
||||
# Find all the namespaces.
|
||||
@@ -55,11 +57,25 @@ then
|
||||
echo "Unexpected: No namespace found. Nothing to do."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
all_failed=1
|
||||
|
||||
for resource in "${resources[@]}"
|
||||
do
|
||||
for namespace in "${namespaces[@]}"
|
||||
do
|
||||
# If get fails, assume it's because the resource hasn't been installed in the apiserver.
|
||||
# TODO hopefully we can remove this once we use dynamic discovery of gettable/updateable
|
||||
# resources.
|
||||
set +e
|
||||
instances=( $("${KUBECTL}" get "${resource}" --namespace="${namespace}" -o go-template="{{range.items}}{{.metadata.name}} {{end}}"))
|
||||
result=$?
|
||||
set -e
|
||||
|
||||
if [[ "${all_failed}" -eq 1 && "${result}" -eq 0 ]]; then
|
||||
all_failed=0
|
||||
fi
|
||||
|
||||
# Nothing to do if there is no instance of that resource.
|
||||
if [[ -z "${instances:-}" ]]
|
||||
then
|
||||
@@ -107,6 +123,11 @@ do
|
||||
done
|
||||
done
|
||||
|
||||
if [[ "${all_failed}" -eq 1 ]]; then
|
||||
echo "kubectl get failed for all resources"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "All objects updated successfully!!"
|
||||
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user