Skip to content

Commit

Permalink
fix: add the missing append (#3047)
Browse files Browse the repository at this point in the history
* fix: add the missing append

* fix: precommit shellcheck

(cherry picked from commit 06bf071)
  • Loading branch information
cwyl02 committed Jan 23, 2025
1 parent 5b05bcb commit d30b3c4
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions hack/list-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,21 @@ done

# These services use raw manifests rather than Helm charts so list the images directly from the manifests.
# If more raw manifest services are added, then they should be added to the list of paths below.
gojq --yaml-input --raw-output 'select(.kind | test("^(?:Deployment|Job|CronJob|StatefulSet|DaemonSet)$")) |
(.spec.template.spec // .spec.jobTemplate.spec.template.spec) |
(select(.containers != null) | .containers[].image), (select(.initContainers != null) | .initContainers[].image)' \
./services/kommander-flux/*/templates/* \
./services/kube-prometheus-stack/*/etcd-metrics-proxy/* \
>>"${IMAGES_FILE}"

# process git operator separately
gojq --yaml-input --raw-output 'select(.kind | test("^(?:Deployment|Job|StatefulSet|DaemonSet)$")) |
.spec.template.spec |
(select(.containers != null) | .containers[].image), (select(.initContainers != null) | .initContainers[].image)' \
./services/git-operator/*/git-operator-manifests/* \
>>"${IMAGES_FILE}"
# we patch the cronjob image in this kustomization
gojq --yaml-input --raw-output 'select(.kind | test("^(?:Kustomization)$")) | .images | map("\(.name):\(.newTag)") | .[]' \
./services/git-operator/*/kustomization.yaml
{
gojq --yaml-input --raw-output 'select(.kind | test("^(?:Deployment|Job|CronJob|StatefulSet|DaemonSet)$")) |
(.spec.template.spec // .spec.jobTemplate.spec.template.spec) |
(select(.containers != null) | .containers[].image), (select(.initContainers != null) | .initContainers[].image)' \
./services/kommander-flux/*/templates/* \
./services/kube-prometheus-stack/*/etcd-metrics-proxy/* \
# process git operator separately
gojq --yaml-input --raw-output 'select(.kind | test("^(?:Deployment|Job|StatefulSet|DaemonSet)$")) |
.spec.template.spec |
(select(.containers != null) | .containers[].image), (select(.initContainers != null) | .initContainers[].image)' \
./services/git-operator/*/git-operator-manifests/* \
# we patch the cronjob image in this kustomization
gojq --yaml-input --raw-output 'select(.kind | test("^(?:Kustomization)$")) | .images | map("\(.name):\(.newTag)") | .[]' \
./services/git-operator/*/kustomization.yaml
} >>"${IMAGES_FILE}"

# Ensure that all images are fully qualified to ensure uniqueness of images in the image bundle.
sed --expression='s|^docker.io/||' \
Expand Down

0 comments on commit d30b3c4

Please sign in to comment.