Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit cfcf384

Browse files
Bart Smyklaalexellis
authored andcommitted
Template "slack_url" for audit trail
Signed-off-by: Bart Smykla <bsmykla@vmware.com>
1 parent e1b3c89 commit cfcf384

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

init.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ github:
100100
oauth:
101101
client_id: 914f3fb036ce9cd774
102102

103+
## Slack
104+
### You can set your own url to get an audit trail in your Slack workspace
105+
slack:
106+
url: http://gateway.openfaas:8080/function/echo
107+
103108
### Users allowed to access your OpenFaaS Cloud
104109
#### ACL for your users, it must be a raw text file or GitHub RAW URL
105110
customers_url: "https://raw.githubusercontent.com/openfaas/openfaas-cloud/master/CUSTOMERS"

pkg/stack/stack.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func Apply(plan types.Plan) error {
5050
return githubConfigErr
5151
}
5252

53+
if slackConfigErr := generateTemplate("slack", plan, types.Slack{
54+
URL: plan.Slack.URL,
55+
}); slackConfigErr != nil {
56+
return slackConfigErr
57+
}
58+
5359
dashboardConfigErr := generateTemplate("dashboard_config", plan, gatewayConfig{
5460
RootDomain: plan.RootDomain, Scheme: scheme,
5561
})

pkg/types/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Plan struct {
1717
S3 S3 `yaml:"s3"`
1818
EnableOAuth bool `yaml:"enable_oauth"`
1919
TLSConfig TLSConfig `yaml:"tls_config"`
20+
Slack Slack `yaml:"slack"`
2021
}
2122

2223
type KeyValueTuple struct {
@@ -53,6 +54,10 @@ type Github struct {
5354
PrivateKeyFile string `yaml:"private_key_filename"`
5455
}
5556

57+
type Slack struct {
58+
URL string `yaml:"url"`
59+
}
60+
5661
type OAuth struct {
5762
ClientId string `yaml:"client_id"`
5863
}

scripts/deploy-cloud-components.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
cp ./tmp/generated-gateway_config.yml ./tmp/openfaas-cloud/gateway_config.yml
44
cp ./tmp/generated-github.yml ./tmp/openfaas-cloud/github.yml
5+
cp ./tmp/generated-slack.yml ./tmp/openfaas-cloud/slack.yml
56
cp ./tmp/generated-dashboard_config.yml ./tmp/openfaas-cloud/dashboard/dashboard_config.yml
67

78
kubectl apply -f ./tmp/openfaas-cloud/yaml/core/of-builder-dep.yml

templates/slack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
environment:
2+
slack_url: "{{.URL}}"

0 commit comments

Comments
 (0)