-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #307 from cwilson21/master
Issue #306 : Adding the ability to use overrides
- Loading branch information
Showing
19 changed files
with
245 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- if .Values.st2.overrides }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Release.Name }}-st2-overrides-configs | ||
annotations: | ||
description: StackStorm override configs defined in helm values, shipped in (or copied to) '/opt/stackstorm/overrides' | ||
labels: | ||
app: st2 | ||
tier: backend | ||
vendor: stackstorm | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
data: | ||
{{ toYaml .Values.st2.overrides | indent 2 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
--- | ||
suite: Overrides check | ||
templates: | ||
# primary template files | ||
- deployments.yaml | ||
- jobs.yaml | ||
- service-account.yaml | ||
|
||
# included templates must also be listed | ||
- configmaps_overrides.yaml | ||
- configmaps_packs.yaml | ||
- configmaps_rbac.yaml | ||
- configmaps_st2-conf.yaml | ||
- configmaps_st2-urls.yaml | ||
- configmaps_st2web.yaml | ||
- secrets_datastore_crypto_key.yaml | ||
- secrets_ssh.yaml | ||
- secrets_st2apikeys.yaml | ||
- secrets_st2auth.yaml | ||
- secrets_st2chatops.yaml | ||
|
||
tests: | ||
- it: Jobs with overrides mounted | ||
template: jobs.yaml | ||
set: | ||
st2: | ||
overrides: #Enabling the overrides mounts in register-content job. | ||
_global.yaml: | | ||
--- | ||
rules: | ||
defaults: | ||
enabled: false | ||
rbac: { enabled: true } # enable rbac job | ||
packs: { sensors: [] } # ensure only 1 sensor | ||
jobs: | ||
extra_hooks: &extra_hooks_jobs | ||
- name: upgrade-warning | ||
hook: pre-upgrade, pre-rollback | ||
hook_weight: -5 | ||
command: ["st2", "run", "--tail", "custom_pack.warn_about_upgrade"] | ||
release: | ||
name: st2ha | ||
asserts: | ||
- hasDocuments: | ||
count: 5 | ||
|
||
- contains: &overrides_volume | ||
path: spec.template.spec.volumes | ||
content: | ||
name: st2-overrides-vol | ||
configMap: | ||
name: st2ha-st2-overrides-configs | ||
documentIndex: 3 # register_content | ||
|
||
|
||
- contains: &overrides_mnt | ||
path: spec.template.spec.containers[0].volumeMounts | ||
content: | ||
name: st2-overrides-vol | ||
mountPath: /opt/stackstorm/overrides | ||
documentIndex: 3 # register_content | ||
|
||
- contains: *overrides_mnt | ||
documentIndex: 4 #Extra_jobs | ||
- contains: *overrides_volume | ||
documentIndex: 4 #extra_jobs | ||
|
||
- notContains: *overrides_volume | ||
documentIndex: 0 | ||
- notContains: *overrides_mnt | ||
documentIndex: 0 | ||
- notContains: *overrides_volume | ||
documentIndex: 1 | ||
- notContains: *overrides_mnt | ||
documentIndex: 1 | ||
- notContains: *overrides_volume | ||
documentIndex: 2 | ||
- notContains: *overrides_mnt | ||
documentIndex: 2 | ||
|
||
|
||
- it: Deployments with overrides | ||
template: deployments.yaml | ||
set: | ||
st2: | ||
overrides: #Enabling the override mounts in register-content job. | ||
_global.yaml: | | ||
--- | ||
rules: | ||
defaults: | ||
enabled: false | ||
packs: | ||
sensors: [] # ensure only 1 sensor | ||
images: [] # no extra packs to load | ||
volumes: | ||
enabled: false | ||
configs: {} # has one core.yaml config file by default (dicts get merged) | ||
st2chatops: | ||
enabled: true | ||
release: | ||
name: st2ha | ||
asserts: | ||
- hasDocuments: | ||
count: 14 | ||
|
||
|
||
- contains: *overrides_volume # always included | ||
documentIndex: 12 # st2client | ||
- contains: *overrides_mnt # always included | ||
documentIndex: 12 # st2client | ||
|
||
|
||
- notContains: *overrides_volume | ||
documentIndex: 1 | ||
- notContains: *overrides_mnt | ||
documentIndex: 1 # st2api | ||
- notContains: *overrides_volume | ||
documentIndex: 10 # st2actionrunner | ||
- notContains: *overrides_mnt | ||
documentIndex: 10 # st2actionrunner | ||
- notContains: *overrides_volume | ||
documentIndex: 0 | ||
- notContains: *overrides_mnt | ||
documentIndex: 0 | ||
- notContains: *overrides_volume | ||
documentIndex: 2 | ||
- notContains: *overrides_mnt | ||
documentIndex: 2 | ||
- notContains: *overrides_volume | ||
documentIndex: 3 | ||
- notContains: *overrides_mnt | ||
documentIndex: 3 | ||
- notContains: *overrides_volume | ||
documentIndex: 4 | ||
- notContains: *overrides_mnt | ||
documentIndex: 4 | ||
- notContains: *overrides_volume | ||
documentIndex: 5 | ||
- notContains: *overrides_mnt | ||
documentIndex: 5 | ||
- notContains: *overrides_volume | ||
documentIndex: 6 | ||
- notContains: *overrides_mnt | ||
documentIndex: 6 | ||
- notContains: *overrides_volume | ||
documentIndex: 7 | ||
- notContains: *overrides_mnt | ||
documentIndex: 7 | ||
- notContains: *overrides_volume | ||
documentIndex: 8 | ||
- notContains: *overrides_mnt | ||
documentIndex: 8 | ||
- notContains: *overrides_volume # never | ||
documentIndex: 9 # st2sensorcontainer | ||
- notContains: *overrides_mnt # never | ||
documentIndex: 9 # st2sensorcontainer | ||
- notContains: *overrides_volume | ||
documentIndex: 11 | ||
- notContains: *overrides_mnt | ||
documentIndex: 11 | ||
- notContains: *overrides_volume | ||
documentIndex: 13 | ||
- notContains: *overrides_mnt | ||
documentIndex: 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.