-
Notifications
You must be signed in to change notification settings - Fork 1
ROX-34138: Make HAProxy configurable #240
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
Open
mclasmeier
wants to merge
16
commits into
main
Choose a base branch
from
mc/haproxy-configurable
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+267
−131
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
eb3116c
Turn --config and --set into top-level flags.
mclasmeier 537fa9d
Add HAProxyConfig to RoxieConfig
mclasmeier 3aade7a
Add assembleConfigForCommand helper
mclasmeier f8d3653
Use assembleConfigForCommand helper.
mclasmeier cc8a2e4
Disable stdin input for spawned command
mclasmeier 0359821
Replace boolean indicator for HAProxy with port integer
mclasmeier 0da2f60
HAProxy configuration rendering
mclasmeier aa94941
Parameterize startHAProxy with RoxieConfig
mclasmeier 07af7e5
New helper tryStartHAProxy
mclasmeier 739951a
Let spawnSubshellForDeployerEnv and runCommandOrSubshell propagate Ro…
mclasmeier 3e45164
Conditional execution of tryStartHAProxy
mclasmeier 2bc9e18
Let shell command also benefit from ad-hoc configurability.
mclasmeier e1714f9
Adjust logging
mclasmeier 2eff914
Fix unit tests
mclasmeier 7aec0ee
Pass second struct as pointer to mergo.Merge
mclasmeier d140a97
Portable stdin reading
mclasmeier 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "dario.cat/mergo" | ||
| "github.com/stackrox/roxie/internal/deployer" | ||
| ) | ||
|
|
||
| func assembleConfigForCommand(configBase *deployer.Config, configFromArgs deployer.Config, skipUserConfig bool) (deployer.Config, error) { | ||
| var config deployer.Config | ||
| if configBase == nil { | ||
| // Start with default configuration. | ||
| config = deployer.DefaultConfig() | ||
| } else { | ||
| config = *configBase | ||
| } | ||
|
|
||
| // Apply user config on top (overriding defaults). | ||
| if !skipUserConfig { | ||
| if err := tryApplyUserDefaults(globalLogger, &config); err != nil { | ||
| return deployer.Config{}, fmt.Errorf("applying user config: %w", err) | ||
| } | ||
| } | ||
|
|
||
| // Apply changes from arg parsing. | ||
| if err := mergo.Merge(&config, &configFromArgs, mergo.WithOverride, mergo.WithoutDereference); err != nil { | ||
| return deployer.Config{}, fmt.Errorf("applying config patches from command line argument: %w", err) | ||
| } | ||
|
|
||
| return config, nil | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.