Skip to content

Commit

Permalink
replace webui.address by webui.url
Browse files Browse the repository at this point in the history
Signed-off-by: Issif <issif_github@gadz.org>
  • Loading branch information
Issif authored and poiana committed Feb 7, 2021
1 parent 44fa5f8 commit 20c6b46
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ kubeless:
# minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

webui:
address: "" # WebUI address, if not empty, WebUI output is enabled
url: "" # WebUI URL, if not empty, WebUI output is enabled
```
Usage :
Expand Down Expand Up @@ -548,7 +548,7 @@ care of lower/uppercases**) : `yaml: a.b --> envvar: A_B` :
- **KUBELESS_MINIMUMPRIORITY**: "debug" # minimum priority of event for using
this output, order is
`emergency|alert|critical|error|warning|notice|informational|debug or "" (default)`
- **WEBUI_ADDRESS** : WebUI address, if not empty, WebUI output is
- **WEBUI_URL** : WebUI URL, if not empty, WebUI output is
_enabled_

#### Slack/Rocketchat/Mattermost/Googlechat Message Formatting
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func getConfig() *types.Configuration {
v.SetDefault("Kubeless.Port", 8080)
v.SetDefault("Kubeless.Kubeconfig", "")
v.SetDefault("Kubeless.MinimumPriority", "")
v.SetDefault("Webui.URL", "http://localhost:2802")

v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.AutomaticEnv()
Expand Down
2 changes: 1 addition & 1 deletion config_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ kubeless:
# minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

webui:
address: "" # WebUI address, if not empty, WebUI output is enabled
url: "" # WebUI URL, if not empty, WebUI output is enabled
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func forwardEvent(falcopayload types.FalcoPayload) {
go kubelessClient.KubelessCall(falcopayload)
}

if config.WebUI.Address != "" {
if config.WebUI.URL != "" {
go webUIClient.WebUIPost(falcopayload)
}
}
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ func init() {
}
}

if config.Webhook.Address != "" {
if config.WebUI.URL != "" {
var err error
webhookClient, err = outputs.NewClient("Webhook", config.Webhook.Address, config, stats, promStats, statsdClient, dogstatsdClient)
webUIClient, err = outputs.NewClient("WebUI", config.WebUI.URL, config, stats, promStats, statsdClient, dogstatsdClient)
if err != nil {
config.Webhook.Address = ""
config.WebUI.URL = ""
} else {
outputs.EnabledOutputs = append(outputs.EnabledOutputs, "Webhook")
outputs.EnabledOutputs = append(outputs.EnabledOutputs, "WebUI")
}
}

Expand Down
2 changes: 1 addition & 1 deletion types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ type kubelessConfig struct {

// WebUIOutputConfig represents parameters for WebUI
type WebUIOutputConfig struct {
Address string
URL string
}

// Statistics is a struct to store stastics
Expand Down

0 comments on commit 20c6b46

Please sign in to comment.