Skip to content

Commit aabf3dc

Browse files
committed
rework st2chatops api_key usage based on feedback
1 parent bb27d16 commit aabf3dc

File tree

4 files changed

+5
-15
lines changed

4 files changed

+5
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Removed reference to st2-license pullSecrets, which was missed when removing enterprise flags (#192) (by @cognifloyd)
66
* Add optional imagePullSecrets to ServiceAccount using `serviceAccount.pullSecret` from values.yaml. If pods do not have imagePullSecrets (eg without `image.pullSecret` in values.yaml), k8s populates them from the ServiceAccount. (#196) (by @cognifloyd)
77
* Reformat some yaml strings so that single quotes wrap strings that include double quotes (#194) (by @cognifloyd)
8-
* Add `st2chatops.api_key` value so that the st2chatops deployment can get the ST2_API_KEY env var instead of ST2_AUTH_USERNAME/PASSWORD. (#197) (by @cognifloyd)
8+
* st2chatops change: If `st2chatops.env.ST2_API_KEY` is defined, do not set `ST2_AUTH_USERNAME` or `ST2_AUTH_PASSWORD` env vars any more. (#197) (by @cognifloyd)
99

1010

1111
## v0.60.0

templates/deployments.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,14 +1376,8 @@ spec:
13761376
- name: st2chatops
13771377
image: '{{ .Values.st2chatops.image.repository | default "stackstorm" }}/{{ .Values.st2chatops.image.name | default "st2chatops" }}:{{ tpl (.Values.st2chatops.image.tag | default .Chart.AppVersion) . }}'
13781378
imagePullPolicy: {{ .Values.st2chatops.image.pullPolicy | default .Values.image.pullPolicy }}
1379+
{{- if not (hasKey .Values.st2chatops.env "ST2_API_KEY") }}
13791380
env:
1380-
{{- if index .Values.st2chatops "api_key" }}
1381-
- name: ST2_API_KEY
1382-
valueFrom:
1383-
secretKeyRef:
1384-
name: {{ .Release.Name }}-st2-auth
1385-
key: chatops_api_key
1386-
{{- else }}
13871381
- name: ST2_AUTH_USERNAME
13881382
valueFrom:
13891383
secretKeyRef:

templates/secrets_st2auth.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ data:
1818
username: {{ required "A valid secret 'st2.username' is required for StackStorm auth!" .Values.secrets.st2.username | b64enc | quote }}
1919
# Password, used to login to StackStorm system (default: Ch@ngeMe)
2020
password: {{ required "A valid secret 'st2.password' is required for StackStorm auth!" .Values.secrets.st2.password | b64enc | quote }}
21-
{{- if index .Values.st2chatops "api_key" }}
22-
# Optional api_key for chatops to use instead of username/password
23-
chatops_api_key: {{ .Values.st2chatops.api_key | b64enc | quote }}
24-
{{- end }}

values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ st2chatops:
422422
env:
423423
HUBOT_ADAPTER: slack
424424
HUBOT_SLACK_TOKEN: xoxb-CHANGE-ME-PLEASE
425-
# If api_key is defined, then use this key instead of username/password for chatops to authenticate with StackStorm.
426-
# Please make sure that this key gets added to st2.apikeys above so that chatops can use this key.
427-
#api_key:
425+
# If ST2_API_KEY is defined, then ST2_AUTH_USERNAME/PASSWORD will not be exposed to st2chatops.
426+
# Please make sure that the key in ST2_API_KEY gets added to st2.apikeys above so that chatops can use this key.
427+
#ST2_API_KEY: 12345
428428
# Set custom generated st2chatops Docker image source
429429
# Otherwise default https://hub.docker.com/r/stackstorm/st2chatops is used
430430
image: {}

0 commit comments

Comments
 (0)