Skip to content

Commit

Permalink
fix: Add service account stuff (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityachoudhari26 authored Aug 29, 2024
1 parent 0b60b2b commit 28082b5
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 23 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
version: v3.7.1
uses: helm/[email protected]

- 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 }}
12 changes: 6 additions & 6 deletions charts/ctrlplane/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 6 additions & 1 deletion charts/ctrlplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
url: https://ctrlplane.dev

dependencies:
- name: webservice
version: "*.*.*"
Expand Down
2 changes: 1 addition & 1 deletion charts/ctrlplane/charts/event-worker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 16 additions & 0 deletions charts/ctrlplane/charts/event-worker/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions charts/ctrlplane/charts/event-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pod: {}
serviceAccount:
create: false
name: ""
labels: {}
annotations: {}

resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion charts/ctrlplane/charts/job-policy-checker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions charts/ctrlplane/charts/job-policy-checker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pod: {}
serviceAccount:
create: false
name: ""
labels: {}
annotations: {}

resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion charts/ctrlplane/charts/migrations/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 16 additions & 0 deletions charts/ctrlplane/charts/migrations/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
6 changes: 6 additions & 0 deletions charts/ctrlplane/charts/migrations/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ job:
labels: {}
annotations: {}

serviceAccount:
create: false
name: ""
labels: {}
annotations: {}

resources:
requests:
cpu: 500m
Expand Down
2 changes: 1 addition & 1 deletion charts/ctrlplane/charts/webservice/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 16 additions & 0 deletions charts/ctrlplane/charts/webservice/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions charts/ctrlplane/charts/webservice/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pod: {}
serviceAccount:
create: false
name: ""
annotations: {}
labels: {}

resources:
requests:
Expand Down

0 comments on commit 28082b5

Please sign in to comment.