Skip to content

Commit

Permalink
Fix standard k8s env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
yacut committed Feb 28, 2021
1 parent 705ba39 commit e74c3bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.4.1 / 2021-02-28

- [FIX] Fix standard k8s env vars

## v1.4.0 / 2021-02-28

- [ENHANCEMENT] Make dynamic pod and node links for better configuration opportunities
Expand Down
12 changes: 11 additions & 1 deletion cmd/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,22 @@ func parseAndValidateFlags() *config.Config {
cfg.Settings.APIKey = ilertAPIKeyEnv
}

namespaceEnv := utils.GetEnv("NAMESPACE", "")
if namespaceEnv != "" {
cfg.Settings.Namespace = namespaceEnv
}

logLevelEnv := utils.GetEnv("LOG_LEVEL", "")
if logLevelEnv != "" {
cfg.Settings.Log.Level = logLevelEnv
}

if cfg.Settings.ElectionID == "" {
log.Fatal().Msg("Election ID is required.")
}

if cfg.Settings.Namespace == "" {
log.Fatal().Msg("Namespace is required.")
log.Fatal().Msg("Namespace is required. Use --settings.namespace flag or NAMESPACE env var")
}

if cfg.Settings.APIKey == "" {
Expand Down
4 changes: 2 additions & 2 deletions example/standard/30-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
serviceAccountName: ilert-kube-agent
containers:
- name: ilert-kube-agent
image: "ilert/ilert-kube-agent:v1.3.0"
image: "ilert/ilert-kube-agent:v1.4.1"
imagePullPolicy: Always
env:
- name: NAMESPACE
Expand All @@ -33,7 +33,7 @@ spec:
- name: PORT
value: "9092"
- name: ILERT_API_KEY
- name: ILERT_SETTINGS_LOG_LEVEL
- name: LOG_LEVEL
value: "info"
ports:
- containerPort: 9092
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package shared

// Version current version
const Version = "v1.4.0"
const Version = "v1.4.1"

// App name
const App = "ilert-kube-agent"

0 comments on commit e74c3bd

Please sign in to comment.