From 0b12097f6fcf7153091bfe0707ca2176ab01c804 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 20 Dec 2024 10:43:16 +0000 Subject: [PATCH] fixup! fixup! fixup! Ensure that jobs run with the controller service account if no service account is specified. --- Makefile | 17 ++++++++++------- api/raczylo.com/v1/zz_generated.deepcopy.go | 5 +++++ chart/Chart.yaml | 4 ++-- chart/templates/deployment.yaml | 3 +-- chart/templates/sa-metrics-service.yaml | 4 ++-- chart/values.yaml | 4 +++- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 3c6afd4..3f3887a 100644 --- a/Makefile +++ b/Makefile @@ -224,13 +224,16 @@ release-chart: rm -fr ../helm-charts/charts/${CHART_NAME} || true mkdir -p ../helm-charts/charts/${CHART_NAME} cp -R chart/* ../helm-charts/charts/${CHART_NAME} - cd ../helm-charts/charts/${CHART_NAME}; \ - cr package --config ../../chart-releaser.yaml; - cd ../helm-charts/; git add -A charts/packages; git fix; git push; - cd ../helm-charts/charts/${CHART_NAME}; cr upload --config ../../chart-releaser.yaml --skip-existing; - cd ../helm-charts/charts/${CHART_NAME}; rm -fr .cr-index; mkdir .cr-index; cr index --config ../../chart-releaser.yaml; cp .cr-index/index.yaml ../../index.yaml; - echo "index.yaml updated" - cd ../helm-charts; git fix; git push + cd ../helm-charts/charts/${CHART_NAME} && \ + cr package --config ../../chart-releaser.yaml + cd ../helm-charts && git add -A charts/packages && git commit -m "Add packaged charts" && git push + cd ../helm-charts/charts/${CHART_NAME} && cr upload --config ../../chart-releaser.yaml --skip-existing + cd ../helm-charts/charts/${CHART_NAME} && \ + rm -fr .cr-index || true && \ + mkdir .cr-index && \ + cr index --config ../../chart-releaser.yaml && \ + cp .cr-index/index.yaml ../../../helm-charts/index.yaml + cd ../helm-charts && git commit -m "Update index.yaml" && git push # go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist # $1 - target path with name of binary diff --git a/api/raczylo.com/v1/zz_generated.deepcopy.go b/api/raczylo.com/v1/zz_generated.deepcopy.go index d3f3639..c758352 100644 --- a/api/raczylo.com/v1/zz_generated.deepcopy.go +++ b/api/raczylo.com/v1/zz_generated.deepcopy.go @@ -148,6 +148,11 @@ func (in *ClusterImageExportSpec) DeepCopyInto(out *ClusterImageExportSpec) { *out = make([]corev1.LocalObjectReference, len(*in)) copy(*out, *in) } + if in.AdditionalImages != nil { + in, out := &in.AdditionalImages, &out.AdditionalImages + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterImageExportSpec. diff --git a/chart/Chart.yaml b/chart/Chart.yaml index ea4a089..3df3826 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -10,9 +10,9 @@ description: | type: application -version: 0.2.17 +version: 0.2.20 -appVersion: "0.2.17" +appVersion: "0.2.20" home: https://github.com/lukaszraczylo/kubernetes-images-sync-operator diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index f9d2058..633ee6e 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -48,7 +48,6 @@ spec: resources: {{- toYaml .Values.sa.manager.resources | nindent 10 }} securityContext: {{- toYaml .Values.sa.manager.containerSecurityContext | nindent 10 }} - securityContext: - runAsNonRoot: true + securityContext: {{- toYaml .Values.sa.podSecurityContext | nindent 8 }} serviceAccountName: {{ include "chart.fullname" . }}-sa terminationGracePeriodSeconds: 10 \ No newline at end of file diff --git a/chart/templates/sa-metrics-service.yaml b/chart/templates/sa-metrics-service.yaml index 8e7d5ed..a32d364 100644 --- a/chart/templates/sa-metrics-service.yaml +++ b/chart/templates/sa-metrics-service.yaml @@ -9,6 +9,6 @@ spec: type: {{ .Values.saMetricsService.type }} selector: control-plane: sa - {{- include "chart.selectorLabels" . | nindent 4 }} + {{- include "chart.selectorLabels" . | nindent 4 }} ports: - {{- .Values.saMetricsService.ports | toYaml | nindent 2 }} \ No newline at end of file + {{- .Values.saMetricsService.ports | toYaml | nindent 2 }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index 53f5f50..134de5f 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -12,7 +12,7 @@ sa: - ALL image: repository: ghcr.io/lukaszraczylo/kubernetes-images-sync-operator - tag: 0.2.17 + tag: 0.2.20 resources: limits: cpu: 500m @@ -20,6 +20,8 @@ sa: requests: cpu: 10m memory: 64Mi + podSecurityContext: + runAsNonRoot: true replicas: 1 serviceAccount: annotations: {}