diff --git a/mgrpxy/cmd/upgrade/kubernetes/kubernetes.go b/mgrpxy/cmd/upgrade/kubernetes/kubernetes.go index 14524e3ba..5dde5ea6e 100644 --- a/mgrpxy/cmd/upgrade/kubernetes/kubernetes.go +++ b/mgrpxy/cmd/upgrade/kubernetes/kubernetes.go @@ -36,7 +36,7 @@ NOTE: for now upgrading on a remote kubernetes cluster is not supported! }, } - pxy_utils.AddImageFlags(cmd) + pxy_utils.AddImageUpgradeFlags(cmd) kubernetes.AddHelmFlags(cmd) diff --git a/mgrpxy/cmd/upgrade/podman/podman.go b/mgrpxy/cmd/upgrade/podman/podman.go index fea5f4589..79348795f 100644 --- a/mgrpxy/cmd/upgrade/podman/podman.go +++ b/mgrpxy/cmd/upgrade/podman/podman.go @@ -36,7 +36,7 @@ NOTE: for now upgrading on a remote podman is not supported! }, } - utils.AddImageFlags(podmanCmd) + utils.AddImageUpgradeFlags(podmanCmd) return podmanCmd } diff --git a/mgrpxy/shared/utils/flags.go b/mgrpxy/shared/utils/flags.go index 3e8692d27..f0c4f3d81 100644 --- a/mgrpxy/shared/utils/flags.go +++ b/mgrpxy/shared/utils/flags.go @@ -64,7 +64,7 @@ func (f *ProxyImageFlags) GetContainerImage(name string) string { return imageUrl } -// AddImageFlags will add the proxy install flags to a command. +// AddImageFlags will add the proxy image flags to a command. func AddImageFlags(cmd *cobra.Command) { cmd.Flags().String("imagesLocation", utils.DefaultNamespace, L("registry URL prefix containing the all the container images")) @@ -78,6 +78,20 @@ func AddImageFlags(cmd *cobra.Command) { addContainerImageFlags(cmd, "tftpd") } +// AddImageUpgradeFlags will add the proxy image flags to an upgrade command. +func AddImageUpgradeFlags(cmd *cobra.Command) { + cmd.Flags().String("imagesLocation", utils.DefaultNamespace, + L("registry URL prefix containing the all the container images")) + cmd.Flags().String("tag", utils.DefaultTag, L("image tag")) + 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'")) + + addContainerImageFlags(cmd, "httpd") + addContainerImageFlags(cmd, "saltBroker") + addContainerImageFlags(cmd, "squid") + addContainerImageFlags(cmd, "ssh") + addContainerImageFlags(cmd, "tftpd") +} func addContainerImageFlags(cmd *cobra.Command, container string) { cmd.Flags().String(container+"-image", "", fmt.Sprintf(L("Image for %s container, overrides the namespace if set"), container))