fix: ensure prefixed commands do not clobber legacy default values#190
Merged
fix: ensure prefixed commands do not clobber legacy default values#190
Conversation
johnstcn
commented
May 14, 2024
|
|
||
| o := runCLI() | ||
|
|
||
| require.Equal(t, o.SetupScript, legacyEnvs["SETUP_SCRIPT"]) |
Member
Author
There was a problem hiding this comment.
review: mostly just fixing expected/actual ordering
johnstcn
commented
May 14, 2024
Comment on lines
+89
to
+101
| // Temporarily removed these from the default settings to prevent conflicts | ||
| // between current and legacy environment variables that add default values. | ||
| // Once the legacy environment variables are phased out, this can be | ||
| // reinstated to the previous default values. | ||
| if len(options.IgnorePaths) == 0 { | ||
| options.IgnorePaths = []string{"/var/run"} | ||
| } | ||
| if options.InitScript == "" { | ||
| options.InitScript = "sleep infinity" | ||
| } | ||
| if options.InitCommand == "" { | ||
| options.InitCommand = "/bin/sh" | ||
| } |
Member
Author
There was a problem hiding this comment.
review: moving this right to the top so it's checked first thing
johnstcn
commented
May 14, 2024
| testImageUbuntu = "localhost:5000/envbuilder-test-ubuntu:latest" | ||
| ) | ||
|
|
||
| func TestInitScriptInitCommand(t *testing.T) { |
Member
Author
There was a problem hiding this comment.
review: this test ensures that INIT_SCRIPT and INIT_COMMAND are executed as specified.
Contributor
There was a problem hiding this comment.
Wondering if this could get done in the previous test without having to create a new one.
BrunoQuaresma
approved these changes
May 14, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ENVBUILDER_INIT_SCRIPT and ENVBUILDER_INIT_COMMAND default values appear to clobber the values of INIT_SCRIPT and INIT_COMMAND if set. It looks like we had already been doing something similar for
IGNORE_PATHS, so applied the same treatment and added an integration test to ensure overriding both of these works.