Skip to content

Commit

Permalink
Add the --registry back to mgrpxy (bsc#1233202)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo committed Dec 13, 2024
1 parent f98118c commit ea785f7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mgradm/shared/utils/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ It will be used as SCC credentials for products synchronization and to pull imag
// AddImageFlag add Image flags to a command.
func AddImageFlag(cmd *cobra.Command) {
cmd.Flags().String("image", defaultImage, L("Image"))
cmd.Flags().String("registry", utils.DefaultRegistry, L("Specify a private registry where pull the images"))
cmd.Flags().String("registry", utils.DefaultRegistry, L("Specify a registry where to pull the images from"))
cmd.Flags().String("tag", utils.DefaultTag, L("Tag Image"))

utils.AddPullPolicyFlag(cmd)
Expand Down
1 change: 0 additions & 1 deletion mgrpxy/cmd/upgrade/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2024 SUSE LLC
//
// SPDX-License-Identifier: Apache-2.0
//go:build ptf

package kubernetes

Expand Down
1 change: 0 additions & 1 deletion mgrpxy/cmd/upgrade/podman/podman_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2024 SUSE LLC
//
// SPDX-License-Identifier: Apache-2.0
//go:build ptf

package podman

Expand Down
1 change: 1 addition & 0 deletions mgrpxy/shared/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func AddSCCFlag(cmd *cobra.Command) {
// AddImageFlags will add the proxy install flags to a command.
func AddImageFlags(cmd *cobra.Command) {
cmd.Flags().String("tag", utils.DefaultTag, L("image tag"))
cmd.Flags().String("registry", utils.DefaultRegistry, L("Specify a registry where to pull the images from"))
utils.AddPullPolicyFlag(cmd)

addContainerImageFlags(cmd, "httpd", "httpd")
Expand Down
2 changes: 2 additions & 0 deletions shared/testutils/flagstests/mgrpxy_kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func AssertProxyHelmFlags(t *testing.T, flags *kubernetes.HelmFlags) {

// ImageProxyFlagsTestArgs is the slice of parameters to use with AssertImageFlags.
var ImageProxyFlagsTestArgs = []string{
"--registry", "myregistry.com",
"--tag", "v1.2.3",
"--pullPolicy", "never",
"--httpd-image", "path/to/httpd",
Expand All @@ -48,6 +49,7 @@ var ImageProxyFlagsTestArgs = []string{

// AssertProxyImageFlags checks that all image flags are parsed correctly.
func AssertProxyImageFlags(t *testing.T, flags *utils.ProxyImageFlags) {
testutils.AssertEquals(t, "Error parsing --registry", "myregistry.com", flags.Registry)
testutils.AssertEquals(t, "Error parsing --tag", "v1.2.3", flags.Tag)
testutils.AssertEquals(t, "Error parsing --pullPolicy", "never", flags.PullPolicy)
testutils.AssertEquals(t, "Error parsing --httpd-image", "path/to/httpd", flags.Httpd.Name)
Expand Down
1 change: 1 addition & 0 deletions uyuni-tools.changes.cbosdo.proxy-registry
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add --registry back to mgrpxy (bsc#1233202)

0 comments on commit ea785f7

Please sign in to comment.