Skip to content

Commit

Permalink
Add env to chart options to be used for Slack and Teams URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Oct 9, 2019
1 parent faae6a7 commit 1cb0989
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/flagger/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ spec:
- --spider
- http://localhost:8080/healthz
timeoutSeconds: 5
{{- if .Values.env }}
env:
{{ toYaml .Values.env | indent 12 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
13 changes: 13 additions & 0 deletions charts/flagger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ msteams:
# MS Teams incoming webhook URL
url:

#env:
#- name: SLACK_URL
# valueFrom:
# secretKeyRef:
# name: slack
# key: url
#- name: MSTEAMS_URL
# valueFrom:
# secretKeyRef:
# name: msteams
# key: url
env: []

leaderElection:
enabled: false
replicaCount: 1
Expand Down
2 changes: 1 addition & 1 deletion cmd/flagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func startLeaderElection(ctx context.Context, run func(), ns string, kubeClient
func initNotifier(logger *zap.SugaredLogger) (client notifier.Interface) {
provider := "slack"
notifierURL := fromEnv("SLACK_URL", slackURL)
if msteamsURL != "" {
if msteamsURL != "" || os.Getenv("MSTEAMS_URL") != "" {
provider = "msteams"
notifierURL = fromEnv("MSTEAMS_URL", msteamsURL)
}
Expand Down

0 comments on commit 1cb0989

Please sign in to comment.