-
Notifications
You must be signed in to change notification settings - Fork 352
[code-simplifier] refactor: use isCliProxyNeeded() in docker.go to remove logic duplication #26168
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,13 +103,9 @@ func collectDockerImages(tools map[string]any, workflowData *WorkflowData, actio | |
| } | ||
| } | ||
|
|
||
| // Add cli-proxy sidecar container when the cli-proxy is needed (explicitly via | ||
| // cli-proxy feature flag, or implicitly via integrity-reactions feature flag) | ||
| // and the AWF version supports it. Without this, --skip-pull causes AWF to fail | ||
| // because the cli-proxy image was never pulled. | ||
| cliProxyNeeded := isFeatureEnabled(constants.CliProxyFeatureFlag, workflowData) || | ||
| isFeatureEnabled(constants.IntegrityReactionsFeatureFlag, workflowData) | ||
| if cliProxyNeeded && awfSupportsCliProxy(firewallConfig) { | ||
| // Add cli-proxy sidecar container when the cli-proxy is needed. | ||
| // Without this, --skip-pull causes AWF to fail because the cli-proxy image was never pulled. | ||
| if isCliProxyNeeded(workflowData) { | ||
|
||
| cliProxyImage := constants.DefaultFirewallRegistry + "/cli-proxy:" + awfImageTag | ||
| if !imageSet[cliProxyImage] { | ||
| images = append(images, cliProxyImage) | ||
|
|
||
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.
collectDockerImages now relies on isCliProxyNeeded(), but docker_cli_proxy_test.go doesn’t currently cover the implicit enablement path via
features.integrity-reactions: true. Adding a test case that asserts the cli-proxy image is included when integrity-reactions is enabled (and excluded when AWF is too old / firewall disabled) would protect this refactor from regressions and verify the image-collection path stays aligned with step generation.