From 28082b584ddc3f3b3de4bf9d5ef10b2323293b88 Mon Sep 17 00:00:00 2001 From: Aditya Choudhari <48932219+adityachoudhari26@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:08:02 -0700 Subject: [PATCH] fix: Add service account stuff (#2) --- .github/workflows/lint-test.yaml | 22 +++++++++---------- charts/ctrlplane/Chart.lock | 12 +++++----- charts/ctrlplane/Chart.yaml | 7 +++++- .../ctrlplane/charts/event-worker/Chart.yaml | 2 +- .../templates/serviceaccount.yaml | 16 ++++++++++++++ .../ctrlplane/charts/event-worker/values.yaml | 2 ++ .../charts/job-policy-checker/Chart.yaml | 2 +- .../templates/serviceaccount.yaml | 16 ++++++++++++++ .../charts/job-policy-checker/values.yaml | 2 ++ charts/ctrlplane/charts/migrations/Chart.yaml | 2 +- .../migrations/templates/serviceaccount.yaml | 16 ++++++++++++++ .../ctrlplane/charts/migrations/values.yaml | 6 +++++ charts/ctrlplane/charts/webservice/Chart.yaml | 2 +- .../webservice/templates/serviceaccount.yaml | 16 ++++++++++++++ .../ctrlplane/charts/webservice/values.yaml | 2 ++ 15 files changed, 102 insertions(+), 23 deletions(-) create mode 100644 charts/ctrlplane/charts/event-worker/templates/serviceaccount.yaml create mode 100644 charts/ctrlplane/charts/job-policy-checker/templates/serviceaccount.yaml create mode 100644 charts/ctrlplane/charts/migrations/templates/serviceaccount.yaml create mode 100644 charts/ctrlplane/charts/webservice/templates/serviceaccount.yaml diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 1fa65bf..881c419 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -13,29 +13,27 @@ jobs: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4.2.0 with: - version: v3.11.3 + version: v3.14.4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: '3.x' + check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.4.0 - with: - version: v3.7.1 + uses: helm/chart-testing-action@v2.6.1 - name: Run chart-testing (list-changed) id: list-changed run: | - changed=$(ct list-changed --config ct.yaml) + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_ENV - else - echo "changed=false" >> $GITHUB_ENV + echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Run chart-testing (lint) - run: ct lint --config ct.yaml + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} diff --git a/charts/ctrlplane/Chart.lock b/charts/ctrlplane/Chart.lock index fa9c9cc..aa4e260 100644 --- a/charts/ctrlplane/Chart.lock +++ b/charts/ctrlplane/Chart.lock @@ -1,15 +1,15 @@ dependencies: - name: webservice repository: file://charts/webservice - version: 0.1.1 + version: 0.1.2 - name: job-policy-checker repository: file://charts/job-policy-checker - version: 0.1.3 + version: 0.1.4 - name: migrations repository: file://charts/migrations - version: 0.1.4 + version: 0.1.5 - name: event-worker repository: file://charts/event-worker - version: 0.1.4 -digest: sha256:06c0e0205e2a1e401c7ee0c91685417f1009aa6e8a2c167b05c00e294ff4b226 -generated: "2024-08-27T21:33:21.473313-05:00" + version: 0.1.5 +digest: sha256:ec8e99b97ebffb2235418bcc5a86e75162fe19b1b1815e48d397770c8390dbc1 +generated: "2024-08-28T17:04:24.261293-07:00" diff --git a/charts/ctrlplane/Chart.yaml b/charts/ctrlplane/Chart.yaml index 1121615..ef5eaa1 100644 --- a/charts/ctrlplane/Chart.yaml +++ b/charts/ctrlplane/Chart.yaml @@ -2,9 +2,14 @@ apiVersion: v2 name: ctrlplane description: Ctrlplane Helm chart for Kubernetes type: application -version: 0.1.6 +version: 0.1.7 appVersion: "1.16.0" +maintainers: + - name: ctrlplane + email: support@ctrlplane.com + url: https://ctrlplane.dev + dependencies: - name: webservice version: "*.*.*" diff --git a/charts/ctrlplane/charts/event-worker/Chart.yaml b/charts/ctrlplane/charts/event-worker/Chart.yaml index 5a1788d..0adc740 100644 --- a/charts/ctrlplane/charts/event-worker/Chart.yaml +++ b/charts/ctrlplane/charts/event-worker/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: event-worker description: A Helm chart for Kubernetes type: application -version: 0.1.4 +version: 0.1.5 appVersion: "1.16.0" diff --git a/charts/ctrlplane/charts/event-worker/templates/serviceaccount.yaml b/charts/ctrlplane/charts/event-worker/templates/serviceaccount.yaml new file mode 100644 index 0000000..6271fac --- /dev/null +++ b/charts/ctrlplane/charts/event-worker/templates/serviceaccount.yaml @@ -0,0 +1,16 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "event-worker.serviceAccountName" . }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "event-worker.labels" . | nindent 4 }} + {{- if .Values.serviceAccount.labels -}} + {{- toYaml .Values.serviceAccount.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.serviceAccount.annotations -}} + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/ctrlplane/charts/event-worker/values.yaml b/charts/ctrlplane/charts/event-worker/values.yaml index ad8af8b..ff1a644 100644 --- a/charts/ctrlplane/charts/event-worker/values.yaml +++ b/charts/ctrlplane/charts/event-worker/values.yaml @@ -32,6 +32,8 @@ pod: {} serviceAccount: create: false name: "" + labels: {} + annotations: {} resources: requests: diff --git a/charts/ctrlplane/charts/job-policy-checker/Chart.yaml b/charts/ctrlplane/charts/job-policy-checker/Chart.yaml index 8fe1210..fba536e 100644 --- a/charts/ctrlplane/charts/job-policy-checker/Chart.yaml +++ b/charts/ctrlplane/charts/job-policy-checker/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: job-policy-checker description: A Helm chart for Kubernetes type: application -version: 0.1.3 +version: 0.1.4 appVersion: "1.16.0" diff --git a/charts/ctrlplane/charts/job-policy-checker/templates/serviceaccount.yaml b/charts/ctrlplane/charts/job-policy-checker/templates/serviceaccount.yaml new file mode 100644 index 0000000..0a31f61 --- /dev/null +++ b/charts/ctrlplane/charts/job-policy-checker/templates/serviceaccount.yaml @@ -0,0 +1,16 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "job-policy-checker.serviceAccountName" . }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "job-policy-checker.labels" . | nindent 4 }} + {{- if .Values.serviceAccount.labels -}} + {{- toYaml .Values.serviceAccount.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.serviceAccount.annotations -}} + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/ctrlplane/charts/job-policy-checker/values.yaml b/charts/ctrlplane/charts/job-policy-checker/values.yaml index 1b5c4ce..a391ca4 100644 --- a/charts/ctrlplane/charts/job-policy-checker/values.yaml +++ b/charts/ctrlplane/charts/job-policy-checker/values.yaml @@ -24,6 +24,8 @@ pod: {} serviceAccount: create: false name: "" + labels: {} + annotations: {} resources: requests: diff --git a/charts/ctrlplane/charts/migrations/Chart.yaml b/charts/ctrlplane/charts/migrations/Chart.yaml index ce783d5..6e8bd6c 100644 --- a/charts/ctrlplane/charts/migrations/Chart.yaml +++ b/charts/ctrlplane/charts/migrations/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: migrations description: A Helm chart for Kubernetes type: application -version: 0.1.4 +version: 0.1.5 appVersion: "1.16.0" diff --git a/charts/ctrlplane/charts/migrations/templates/serviceaccount.yaml b/charts/ctrlplane/charts/migrations/templates/serviceaccount.yaml new file mode 100644 index 0000000..9126ebe --- /dev/null +++ b/charts/ctrlplane/charts/migrations/templates/serviceaccount.yaml @@ -0,0 +1,16 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "migrations.serviceAccountName" . }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "migrations.labels" . | nindent 4 }} + {{- if .Values.serviceAccount.labels -}} + {{- toYaml .Values.serviceAccount.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.serviceAccount.annotations -}} + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/ctrlplane/charts/migrations/values.yaml b/charts/ctrlplane/charts/migrations/values.yaml index 9589d73..39cfe77 100644 --- a/charts/ctrlplane/charts/migrations/values.yaml +++ b/charts/ctrlplane/charts/migrations/values.yaml @@ -19,6 +19,12 @@ job: labels: {} annotations: {} +serviceAccount: + create: false + name: "" + labels: {} + annotations: {} + resources: requests: cpu: 500m diff --git a/charts/ctrlplane/charts/webservice/Chart.yaml b/charts/ctrlplane/charts/webservice/Chart.yaml index 2888932..23aed21 100644 --- a/charts/ctrlplane/charts/webservice/Chart.yaml +++ b/charts/ctrlplane/charts/webservice/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: webservice description: A Helm chart for Kubernetes type: application -version: 0.1.1 +version: 0.1.2 appVersion: "1.16.0" diff --git a/charts/ctrlplane/charts/webservice/templates/serviceaccount.yaml b/charts/ctrlplane/charts/webservice/templates/serviceaccount.yaml new file mode 100644 index 0000000..e3b7e67 --- /dev/null +++ b/charts/ctrlplane/charts/webservice/templates/serviceaccount.yaml @@ -0,0 +1,16 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "webservice.serviceAccountName" . }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "webservice.labels" . | nindent 4 }} + {{- if .Values.serviceAccount.labels -}} + {{- toYaml .Values.serviceAccount.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.serviceAccount.annotations -}} + {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/ctrlplane/charts/webservice/values.yaml b/charts/ctrlplane/charts/webservice/values.yaml index cc4c2f7..532fae3 100644 --- a/charts/ctrlplane/charts/webservice/values.yaml +++ b/charts/ctrlplane/charts/webservice/values.yaml @@ -32,6 +32,8 @@ pod: {} serviceAccount: create: false name: "" + annotations: {} + labels: {} resources: requests: