Skip to content

Commit

Permalink
feat: support imagePullSecrets on the service account as well as the …
Browse files Browse the repository at this point in the history
…deployment (#28)

* feat: support imagePullSecrets on the service account as well as the deployment
  • Loading branch information
knechtionscoding authored Feb 3, 2023
1 parent e1090aa commit 3a39ffc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/pact-broker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pact-broker
description: The Pact Broker is an application for sharing for Pact contracts and verification results.
type: application
version: 0.5.2
version: 0.6.0
appVersion: 2.105.0.1
dependencies:
- condition: postgresql.enabled
Expand Down
3 changes: 2 additions & 1 deletion charts/pact-broker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pact-broker

![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.105.0.1](https://img.shields.io/badge/AppVersion-2.105.0.1-informational?style=flat-square)
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.105.0.1](https://img.shields.io/badge/AppVersion-2.105.0.1-informational?style=flat-square)

The Pact Broker is an application for sharing for Pact contracts and verification results.

Expand Down Expand Up @@ -185,6 +185,7 @@ helm upgrade -i <release_name> oci://ghcr.io/pact-foundation/pact-broker-chart/p
| serviceAccount.annotations | Additional custom annotations for the ServiceAccount. | object | `{}` |
| serviceAccount.automountServiceAccountToken | Auto-mount the service account token in the pod | bool | `true` |
| serviceAccount.create | Enable the creation of a ServiceAccount for Pact Broker pods | bool | `true` |
| serviceAccount.imagePullSecrets | Name of image pull secrets that should be attached to the service account | list | `[]` |
| serviceAccount.labels | Additional custom labels to the service ServiceAccount. | object | `{}` |
| serviceAccount.name | Name of the created ServiceAccount If not set and `serviceAccount.create` is true, a name is generated | string | `"broker-sa"` |

Expand Down
20 changes: 14 additions & 6 deletions charts/pact-broker/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{{- if .Values.serviceAccount.create }}
{{- with .Values.serviceAccount }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
name: {{ .name }}
namespace: {{ $.Release.Namespace }}
labels:
app.kubernetes.io/component: pact-broker
{{- with .Values.serviceAccount.labels }}
{{- with .labels }}
{{ toYaml . | trim | indent 8 }}
{{- end }}
{{- if .Values.serviceAccount.annotations }}
{{- if .annotations }}
annotations:
{{- with .Values.serviceAccount.annotations }}
{{- with .annotations }}
{{ toYaml . | trim | indent 8 }}
{{- end }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ .automountServiceAccountToken }}
{{- if .imagePullSecrets }}
imagePullSecrets:
{{- range .imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/pact-broker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,6 @@ serviceAccount:

# -- Auto-mount the service account token in the pod
automountServiceAccountToken: true

# -- Name of image pull secrets that should be attached to the service account
imagePullSecrets: []

0 comments on commit 3a39ffc

Please sign in to comment.