-
Notifications
You must be signed in to change notification settings - Fork 13
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
Document, test, and fix required environment variables for CUA #71
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
31c4c17
fix(environment/Windows): Document and add debugging information to r…
aesca1er 53f6a7e
fix(plugins/ecs): ECS v3 endpoint environment var is documented with …
aesca1er 2463bac
fix(env/testutil): Testutil DOCKER_HOST environment var is documented…
aesca1er c123575
fix(env/plugins): Document and provide debug info for environment vars
aesca1er e26caa0
docs(environment): Documentation for requried environment vars
aesca1er 76b2d25
docs(environment): Move environment vars documentation to docs dir
aesca1er 5a2be53
fix(env/defaults): Inject sensible defaults where needed
aesca1er 2e32492
style(fmt): Format all source files with go fmt
aesca1er File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# CUA Env vars | ||
|
||
|
||
## Windows | ||
|
||
- "ProgramFiles" - if unset, logs an error | ||
- "WINDIR" - if unset, logs an error | ||
|
||
## Linux | ||
|
||
- "HOST_PROC" - returns "/proc" if unset. | ||
- "HOST_MOUNT_PREFIX" - plugins/inputs/system/ps used for host volume mounts | ||
|
||
## Universal | ||
|
||
- "ENABLE_DEFAULT_PLUGINS" - if set to "false", disables default plugins | ||
- "CUA_CONFIG_PATH" - if set, overrides any other config file | ||
- "ECS_CONTAINER_METADATA_URI" - if set, enables ecs v3 endpoint. if unset, v2 is used. | ||
- "DOCKER_HOST" - if unset, defaults to "localhost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//go:build generate | ||
// +build generate | ||
|
||
package main | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it matters for this or not, but os.Getenv() will return an empty string whether the environment variable is set to an empty string or just does not exist. If you need to distinguish these two cases there is os.LookupEnv().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to hit "comment" on my PR about this function heh.
This is a pretty generic function. Are we expecting ENV vars to always be set? If someone is driving this off config, rather than env, this will be noisy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my understanding of the shim is that it's used to expand ENV vars in the config. In this, it will notify if any env var in the config is empty or unset.