Skip to content

Commit

Permalink
change default value for pull policy during upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Apr 18, 2024
1 parent 80b51c8 commit 48b76bc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mgradm/cmd/upgrade/shared/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ type UpgradeFlags struct {

// AddUpgradeFlags add upgrade flags to a command.
func AddUpgradeFlags(cmd *cobra.Command) {
utils.AddImageFlag(cmd)
utils.AddImageUpgradeFlag(cmd)
utils.AddMigrationImageFlag(cmd)
}

// AddUpgradeListFlags add upgrade list flags to a command.
func AddUpgradeListFlags(cmd *cobra.Command) {
utils.AddImageFlag(cmd)
utils.AddImageUpgradeFlag(cmd)
}
12 changes: 10 additions & 2 deletions mgradm/shared/utils/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,26 @@ func AddHelmInstallFlag(cmd *cobra.Command) {
cmd.Flags().String("helm-certmanager-values", "", L("Path to a values YAML file to use for cert-manager helm install"))
}

// AddimageFlag add Image flags to a command.
// AddImageFlag add Image flags to a command.
func AddImageFlag(cmd *cobra.Command) {
cmd.Flags().String("image", defaultImage, L("Image"))
cmd.Flags().String("tag", utils.DefaultTag, L("Tag Image"))

utils.AddPullPolicyFlag(cmd)
}

// AddImageUpgradeFlag add Image flags to an upgrade command, where pullPolicy default is always.
func AddImageUpgradeFlag(cmd *cobra.Command) {
cmd.Flags().String("image", defaultImage, L("Image"))
cmd.Flags().String("tag", utils.DefaultTag, L("Tag Image"))
cmd.Flags().String("pullPolicy", "Always",
L("set whether to pull the images or not during upgrade. The value can be one of 'Never', 'IfNotPresent' or 'Always'"))
}

// AddMigrationImageFlag add Migration Image flags to a command.
func AddMigrationImageFlag(cmd *cobra.Command) {
cmd.Flags().String("migration-image", "", L("Migration image"))
cmd.Flags().String("migration-tag", utils.DefaultTag, L("Migration image tag"))
cmd.Flags().String("migration-pullPolicy", "IfNotPresent",
L("set whether to pull the migrattion images or not. The value can be one of 'Never', 'IfNotPresent' or 'Always'"))
L("set whether to pull the migration images or not. The value can be one of 'Never', 'IfNotPresent' or 'Always'"))
}
2 changes: 2 additions & 0 deletions uyuni-tools.changes.mbussolotto.pull_policy_upgrade
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- change pull policy default to Always during upgrade
- change pull policy default for migration image to Never during upgrade

0 comments on commit 48b76bc

Please sign in to comment.