feat(nodeadm): add support to configure http-proxy for al2023/nodeadm#2384
feat(nodeadm): add support to configure http-proxy for al2023/nodeadm#2384shvbsle merged 28 commits intoawslabs:mainfrom
Conversation
pattern. Handled escape quotes
|
/ci |
|
/ci |
…v files separately
|
/ci |
|
I'm defining the following system aspect before the config phase is invoked: preConfigAspects := []system.SystemAspect{
system.NewEnvironmentAspect(),
}This is because, |
…e-equal directive for testcases
|
/ci |
nodeadm/cmd/nodeadm/init/init.go
Outdated
| system.NewInstanceEnvironmentAspect(), | ||
| } | ||
|
|
||
| runAspects := []system.SystemAspect{ |
There was a problem hiding this comment.
nit: should this be defined on line 140 just before it's used?
|
|
||
| const ( | ||
| instanceEnvironmentAspectName = "instance-environment" | ||
| nodeamdEnvironmentAspectName = "nodeadm-environment" |
| } | ||
|
|
||
| // Reload systemd configuration once after all config files are written | ||
| zap.L().Info("Reloading systemd configuration") |
There was a problem hiding this comment.
this will still trigger daemon reload if all the maps within EnvironmentOptions are empty, it's alright if you don't fix this though.
|
|
||
| zap.L().Info("All envOpts: ", zap.Any("=", envOpts)) | ||
| for serviceName, envVars := range envOpts { | ||
| if len(envVars) > 0 { |
There was a problem hiding this comment.
nit: invert if condition:
if len(envVars) == 0 {
continue
}
to reduce indentation
| var buf bytes.Buffer | ||
| if err := tmpl.Execute(&buf, configData); err != nil { | ||
| zap.L().Error("Failed to execute environment config template", zap.Error(err)) | ||
| return "" |
There was a problem hiding this comment.
why log the error here vs returning it and logging at a higher level
by returning "" here you will write empty configs when you get an error.
|
/ci |
|
CI is flaky but hoping its smoother now /ci edit: nvm: doesnt work after merging |
|
@shvbsle this PR is not currently mergeable, you'll need to rebase it first. |
|
@shvbsle can you add example usage docs for this change? |
Issue #, if available:
#2128
Description of changes:
Nodeadm has two phases: 1. Config and 2. Run. Nodeadm has a set of outbound API calls (IMDS, AWS API calls) that could potentially need to be routed through a proxy. Currently, setting proxy configurations would happen after the config phase in user-data. This PR adds support to configure http-proxy in
NodeConfigSpec.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing Done
See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.