Skip to content

feat: allow for configurable image push logic in the library #4002

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
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/pkg/packager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ type DeployOptions struct {
NamespaceOverride string
// Remote Options for image pushes
RemoteOptions
// [alpha] Whether to skip image push
NoImagePush bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this corresponds directly to the param name in deployComponent but let's call the SDK-level configuration something active, likeDisableImagePush.

cc @zarf-dev/maintainers

// How to configure Zarf state if it's not already been configured
GitServer state.GitServerInfo
RegistryInfo state.RegistryInfo
Expand Down Expand Up @@ -209,7 +211,7 @@ func (d *deployer) deployComponents(ctx context.Context, pkgLayout *layout.Packa
if pkgLayout.Pkg.IsInitConfig() {
charts, deployErr = d.deployInitComponent(ctx, pkgLayout, component, opts)
} else {
charts, deployErr = d.deployComponent(ctx, pkgLayout, component, false, false, opts)
charts, deployErr = d.deployComponent(ctx, pkgLayout, component, false, opts.NoImagePush, opts)
}

onDeploy := component.Actions.OnDeploy
Expand Down Expand Up @@ -295,9 +297,11 @@ func (d *deployer) deployInitComponent(ctx context.Context, pkgLayout *layout.Pa
}
}

noImagePush := isSeedRegistry || opts.NoImagePush

// Skip image checksum if component is agent.
// Skip image push if component is seed registry.
charts, err := d.deployComponent(ctx, pkgLayout, component, isAgent, isSeedRegistry, opts)
charts, err := d.deployComponent(ctx, pkgLayout, component, isAgent, noImagePush, opts)
if err != nil {
return nil, err
}
Expand Down
Loading