mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-11-06 05:17:08 +00:00
Merge pull request #143437 from thc1006/fix/gce-ready-image-20261026
cluster/gce: filter image families by READY status
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -60,7 +60,7 @@ kube_master_image="${KUBE_GCE_MASTER_IMAGE:-}"
|
||||
if [[ -z "${kube_master_image}" ]]; then
|
||||
# remove architecture:X86_64 once we move on from ubuntu jammy as that image family has both X86_64 and ARM images
|
||||
# a family may briefly contain more than one non-deprecated image; take the newest (the family head)
|
||||
kube_master_image=$(gcloud compute images list --project="${MASTER_IMAGE_PROJECT}" --no-standard-images --filter="family:${MASTER_IMAGE_FAMILY} architecture:X86_64" --sort-by='~creationTimestamp' --limit=1 --format 'value(name)')
|
||||
kube_master_image=$(gcloud compute images list --project="${MASTER_IMAGE_PROJECT}" --no-standard-images --filter="family:${MASTER_IMAGE_FAMILY} architecture:X86_64 status=(READY)" --sort-by='~creationTimestamp' --limit=1 --format 'value(name)')
|
||||
fi
|
||||
|
||||
echo "Using image: ${kube_master_image} from project: ${MASTER_IMAGE_PROJECT} as master image" >&2
|
||||
@@ -81,7 +81,7 @@ function set-linux-node-image() {
|
||||
if [[ -z "${kube_node_image}" ]]; then
|
||||
# remove architecture:X86_64 once we move on from ubuntu jammy as that image family has both X86_64 and ARM images
|
||||
# a family may briefly contain more than one non-deprecated image; take the newest (the family head)
|
||||
kube_node_image=$(gcloud compute images list --project="${NODE_IMAGE_PROJECT}" --no-standard-images --filter="family:${NODE_IMAGE_FAMILY} architecture:X86_64" --sort-by='~creationTimestamp' --limit=1 --format 'value(name)')
|
||||
kube_node_image=$(gcloud compute images list --project="${NODE_IMAGE_PROJECT}" --no-standard-images --filter="family:${NODE_IMAGE_FAMILY} architecture:X86_64 status=(READY)" --sort-by='~creationTimestamp' --limit=1 --format 'value(name)')
|
||||
fi
|
||||
|
||||
echo "Using image: ${kube_node_image} from project: ${NODE_IMAGE_PROJECT} as node image" >&2
|
||||
|
||||
Reference in new issue
Block a user