Skip to content

Commit

Permalink
fix: git operator cronjob use same kubectl (#3000)
Browse files Browse the repository at this point in the history
* fix: use the same kubectl for gitoperator cronjob

* chore: patch the cronjob image from kustomization

* refactor: use kustomization to swap image

* refactor: use patch to replace img

* chore: add kubectl 1296 back to license yaml

* refactor: use extra-images for git-operator

* refactor: fix list images for git operator
  • Loading branch information
cwyl02 authored Jan 9, 2025
1 parent 1d7eea5 commit 60ba482
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 10 additions & 1 deletion hack/list-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,20 @@ done
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/git-operator/*/git-operator-manifests/* \
./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

# Ensure that all images are fully qualified to ensure uniqueness of images in the image bundle.
sed --expression='s|^docker.io/||' \
--expression='s|\(^[^/]\+$\)|library/\1|' \
Expand Down
5 changes: 0 additions & 5 deletions licenses.d2iq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,6 @@ resources:
- url: https://github.com/NVIDIA/cuda-samples
ref: v12.5
license_path: LICENSE
- container_image: docker.io/bitnami/kubectl:1.29.6
sources:
- url: https://github.com/kubernetes/kubectl
ref: v0${image_tag#1}
license_path: LICENSE
- container_image: docker.io/bitnami/kubectl:1.30.5
sources:
- url: https://github.com/kubernetes/kubectl
Expand Down
3 changes: 3 additions & 0 deletions services/git-operator/0.1.2/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ patches:
target:
kind: Certificate
name: git-operator-git-webserver
images:
- name: bitnami/kubectl
newTag: 1.30.5

0 comments on commit 60ba482

Please sign in to comment.