Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): Env var config can now add new items #2653

Merged
merged 1 commit into from
Nov 19, 2021
Merged

Conversation

docmerlin
Copy link
Contributor

This allows for example: adding new headers to httpposts via
environmental variables

This allows for example: adding new headers to httpposts via
environmental variables
Copy link
Contributor

@lesam lesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -2,6 +2,57 @@ module github.com/influxdata/kapacitor

go 1.17

require (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here? Non-blocking, just weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go mod tidy the new version sorts differently, and maintains sorting.

@@ -640,8 +638,28 @@ func (c *Config) applyEnvOverridesToStruct(prefix string, s reflect.Value) error
}
}
} else if f.Kind() == reflect.Map {
for _, k := range f.MapKeys() {
if err := c.applyEnvOverridesToMap(fmt.Sprintf("%s_%v", key, k), fieldName, f, k, f.MapIndex(k)); err != nil {
keys := map[string]reflect.Value{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this only for kapacitor.conf ?

Copy link
Contributor Author

@docmerlin docmerlin Nov 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and environmental variable config of kap.

@docmerlin docmerlin merged commit a353257 into master Nov 19, 2021
@docmerlin docmerlin deleted the env-overrides branch November 19, 2021 21:30
@timhallinflux
Copy link
Contributor

@docmerlin does this close: #2280 ?

@docmerlin
Copy link
Contributor Author

@timhallinflux yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants