From 60ba482628f043309c2d7c44f96889d2919d31f6 Mon Sep 17 00:00:00 2001 From: "Weiyanli Chen(York)" Date: Thu, 9 Jan 2025 15:03:04 -0500 Subject: [PATCH] fix: git operator cronjob use same kubectl (#3000) * 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 --- hack/list-images.sh | 11 ++++++++++- licenses.d2iq.yaml | 5 ----- services/git-operator/0.1.2/kustomization.yaml | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hack/list-images.sh b/hack/list-images.sh index d78f92713c..e31b5db116 100755 --- a/hack/list-images.sh +++ b/hack/list-images.sh @@ -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|' \ diff --git a/licenses.d2iq.yaml b/licenses.d2iq.yaml index 2fd4c095d2..1804cf76d3 100644 --- a/licenses.d2iq.yaml +++ b/licenses.d2iq.yaml @@ -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 diff --git a/services/git-operator/0.1.2/kustomization.yaml b/services/git-operator/0.1.2/kustomization.yaml index 88bde23ba3..672c786030 100644 --- a/services/git-operator/0.1.2/kustomization.yaml +++ b/services/git-operator/0.1.2/kustomization.yaml @@ -25,3 +25,6 @@ patches: target: kind: Certificate name: git-operator-git-webserver +images: + - name: bitnami/kubectl + newTag: 1.30.5