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

correct handling of env overrides for scalar slice elements #6059

Conversation

jonseymour
Copy link
Contributor

  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)

This is a backport of a fix to cmd/influxd/run/config.go that was applied to a fork of the same code in influxdata/kapacitor.

As it happens, influxdb doesn't seem to use any scalar arrays or slices - it does have slices of
structs - but if it ever did introduce such arrays or slices then env overrides would not work for them. This change pre-emptively fixes the issue in the same way it was fixed in kapacitor - see influxdata/kapacitor#350

Signed-off-by: Jon Seymour [email protected]

@jonseymour
Copy link
Contributor Author

@offlinehacker here's the change to influx although it isn't actually needed right now.

@e-dard
Copy link
Contributor

e-dard commented Jul 28, 2016

Hi @jonseymour

here's the change to influx although it isn't actually needed right now.

Can you clarify that?

Is this fix still needed. I think some of the env stuff has changed since March.

@jonseymour
Copy link
Contributor Author

jonseymour commented Jul 28, 2016

Hi @e-dard.

The issue is a latent flaw in the configuration parser. The flaw currently isn't demonstrable because the influxd configuration does not contain arrays within sections. What I mean by this is most easily explained by using this snippet from the kapacitor configuration which does use arrays within sections.

[[influxdb]]
  enabled = true
  name = "default"
  default = false
  urls = ["http://localhost:8086"]

The flaw in the kapacitord parser has been fixed. Since that was derived from the influxd parser, I back ported the fix from there to here.

I will check whether the latent issue still exists (by putting some dummy arrays into the configuration) and if it is still an issue I'll rebase my fixes. Otherwise, I'll close this PR.

@jsternberg
Copy link
Contributor

This PR needs to be updated. I'm going to close this for now since we haven't been able to merge it, but if you rebase and comment, I'll reopen it for review. Thanks.

@jsternberg jsternberg closed this Sep 15, 2016
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