Skip to content

Commit

Permalink
Add configuration property hivemqPlatformServiceAccount.name
Browse files Browse the repository at this point in the history
  • Loading branch information
Donnerbart committed May 29, 2024
1 parent 81b5a46 commit 30edb5a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion charts/hivemq-platform-operator/templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ spec:
- name: hivemq.platform.operator.serviceaccount.create
value: "{{ .Values.hivemqPlatformServiceAccount.create }}"
- name: hivemq.platform.operator.serviceaccount.validate
value: "{{ .Values.platformServiceAccount.validate }}"
value: "{{ .Values.hivemqPlatformServiceAccount.validate }}"
- name: hivemq.platform.operator.serviceaccount.name
value: "{{ .Values.hivemqPlatformServiceAccount.name }}"
- name: hivemq.platform.operator.serviceaccount.permissions.create
value: "{{ .Values.hivemqPlatformServiceAccount.permissions.create }}"
- name: hivemq.platform.operator.serviceaccount.permissions.validate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ tests:
content:
name: hivemq.platform.operator.serviceaccount.validate
value: "true"
- contains:
path: spec.template.spec.containers[0].env
content:
name: hivemq.platform.operator.serviceaccount.name
value: ""
- contains:
path: spec.template.spec.containers[0].env
content:
Expand Down Expand Up @@ -328,6 +333,20 @@ tests:
name: hivemq.platform.operator.serviceaccount.validate
value: "false"

- it: with platform service account name set
set:
hivemqPlatformServiceAccount.name: "my-serviceaccount-name"
asserts:
- exists:
path: spec.template.spec.containers[0]
- exists:
path: spec.template.spec.containers[0].env
- contains:
path: spec.template.spec.containers[0].env
content:
name: hivemq.platform.operator.serviceaccount.name
value: "my-serviceaccount-name"

- it: with platform service account permissions create disabled
set:
hivemqPlatformServiceAccount.permissions.create: false
Expand Down
3 changes: 3 additions & 0 deletions charts/hivemq-platform-operator/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@
"validate" : {
"type" : "boolean"
},
"name" : {
"type" : "string"
},
"permissions" : {
"type" : "object",
"properties" : {
Expand Down
4 changes: 4 additions & 0 deletions charts/hivemq-platform-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ hivemqPlatformServiceAccount:
create: true
# Specifies whether the ServiceAccount for all HiveMQ Platforms should be validated.
validate: true
# The ServiceAccount name that is used for all HiveMQ Platforms.
# This overrides the default name "hivemq-platform-pod-<platform-name>" the Operator creates.
# The ServiceAccount can also be overridden in the HiveMQ Platform Helm chart (see nodes.serviceAccountName) for each specific HiveMQ Platform.
name: ""
permissions:
# Specifies whether the RBAC permissions for the ServiceAccount should be created for all HiveMQ Platforms.
create: true
Expand Down
2 changes: 2 additions & 0 deletions manifests/hivemq-platform-operator/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ spec:
value: "true"
- name: hivemq.platform.operator.serviceaccount.validate
value: "true"
- name: hivemq.platform.operator.serviceaccount.name
value: ""
- name: hivemq.platform.operator.serviceaccount.permissions.create
value: "true"
- name: hivemq.platform.operator.serviceaccount.permissions.validate
Expand Down

0 comments on commit 30edb5a

Please sign in to comment.