Skip to content
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

feat: adds retries flag #532

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/cmd/uds.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ func init() {
deployCmd.Flags().BoolVarP(&config.CommonOptions.Confirm, "confirm", "c", false, lang.CmdBundleDeployFlagConfirm)
deployCmd.Flags().StringArrayVarP(&bundleCfg.DeployOpts.Packages, "packages", "p", []string{}, lang.CmdBundleDeployFlagPackages)
deployCmd.Flags().BoolVarP(&bundleCfg.DeployOpts.Resume, "resume", "r", false, lang.CmdBundleDeployFlagResume)
deployCmd.Flags().IntVar(&bundleCfg.DeployOpts.Retries, "retries", 1, lang.CmdBundleDeployFlagRetries)

// inspect cmd flags
rootCmd.AddCommand(inspectCmd)
Expand Down
1 change: 1 addition & 0 deletions src/config/lang/lang.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
CmdBundleDeployFlagPackages = "Specify which zarf packages you would like to deploy from the bundle. By default all zarf packages in the bundle are deployed."
CmdBundleDeployFlagResume = "Only deploys packages from the bundle which haven't already been deployed"
CmdBundleDeployFlagSet = "Specify deployment variables to set on the command line (KEY=value)"
CmdBundleDeployFlagRetries = "Specify the number of retries for package deployments (applies to all pkgs in a bundle)"

// bundle inspect
CmdBundleInspectShort = "Display the metadata of a bundle"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/bundle/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func deployPackages(packages []types.Package, resume bool, b *Bundle) error {
OptionalComponents: strings.Join(pkg.OptionalComponents, ","),
PublicKeyPath: publicKeyPath,
SetVariables: pkgVars,
Retries: 1,
Retries: b.cfg.DeployOpts.Retries,
}

valuesOverrides, err := b.loadChartOverrides(pkg, pkgVars)
Expand Down
2 changes: 1 addition & 1 deletion src/test/e2e/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func inspectLocalAndSBOMExtract(t *testing.T, tarballPath string) {
}

func deploy(t *testing.T, tarballPath string) (stdout string, stderr string) {
cmd := strings.Split(fmt.Sprintf("deploy %s --confirm --no-tea", tarballPath), " ")
cmd := strings.Split(fmt.Sprintf("deploy %s --retries 1 --confirm --no-tea", tarballPath), " ")
stdout, stderr, err := e2e.UDS(cmd...)
require.NoError(t, err)
return stdout, stderr
Expand Down
1 change: 1 addition & 0 deletions src/types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type BundleDeployOptions struct {
Variables map[string]map[string]interface{} `yaml:"variables,omitempty"`
SharedVariables map[string]interface{} `yaml:"shared,omitempty"`
ZarfPackageNameMap map[string]string `yaml:"-" json:"-"`
Retries int `yaml:"retries"`
}

// BundleInspectOptions is the options for the bundler.Inspect() function
Expand Down
Loading