Skip to content

Commit bd1525a

Browse files
committed
chore: clean up add-on args
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
1 parent 78e317e commit bd1525a

5 files changed

Lines changed: 12 additions & 21 deletions

File tree

pkg/cmd/install/hubaddon/cmd.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,9 @@ func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, stream
4848
},
4949
}
5050

51-
cmd.Flags().StringVar(&o.names, "names", "", "Names of the built-in add-on to install (comma separated). The built-in add-ons are: argocd, argocd-agent, governance-policy-framework")
52-
cmd.Flags().StringVar(&o.values.Namespace, "namespace", "open-cluster-management", "Namespace of the built-in add-on to install. Defaults to open-cluster-management")
53-
cmd.Flags().BoolVar(&o.values.CreateNamespace, "create-namespace", false, "If true, automatically create the specified namespace")
54-
cmd.Flags().StringVar(&o.outputFile, "output-file", "", "The generated resources will be copied in the specified file")
55-
cmd.Flags().StringVar(&o.bundleVersion, "bundle-version", "default",
56-
"The image version tag to use when deploying the hub add-on(s) (e.g. v0.6.0). Defaults to the latest released version. You can also set \"latest\" to install the latest development version.")
57-
cmd.Flags().StringVar(&o.versionBundleFile, "bundle-version-overrides", "",
58-
"Path to a file containing version bundle overrides. Optional. If provided, overrides component versions within the selected version bundle.")
51+
cmd.Flags().StringVar(&o.names, "names", "", "Names of the add-ons to install (comma separated) from the "+chartRepoURL+" repository. The built-in add-ons are: argocd, argocd-agent, governance-policy-framework")
52+
cmd.Flags().StringVar(&o.namespace, "namespace", "", "Namespace in which to install the add-ons. If not provided, the add-ons will be installed according to their chart.")
53+
cmd.Flags().BoolVar(&o.createNamespace, "create-namespace", false, "If true, automatically create the specified namespace.")
5954
cmd.Flags().StringVar(&o.chartVersion, "chart-version", "", "The chart version to use when deploying the hub add-on(s) (e.g. 0.6.0). Defaults to an empty string, which will fetch the latest released version.")
6055

6156
return cmd

pkg/cmd/install/hubaddon/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const (
1818
)
1919

2020
func (o *Options) complete(cmd *cobra.Command, args []string) (err error) {
21-
klog.V(1).InfoS("addon options:", "dry-run", o.ClusteradmFlags.DryRun, "names", o.names, "output-file", o.outputFile)
21+
klog.V(1).InfoS("addon options:", "dry-run", o.ClusteradmFlags.DryRun, "names", o.names)
2222
return nil
2323
}
2424

pkg/cmd/install/hubaddon/options.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@ package hubaddon
33

44
import (
55
"k8s.io/cli-runtime/pkg/genericiooptions"
6-
7-
"open-cluster-management.io/clusteradm/pkg/cmd/install/hubaddon/scenario"
86
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions"
97
"open-cluster-management.io/clusteradm/pkg/helpers/helm"
108
)
119

1210
type Options struct {
13-
//ClusteradmFlags: The generic options from the clusteradm cli-runtime.
11+
//ClusteradmFlags: The generic options from the clusteradm cli-runtime
1412
ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags
1513
//A list of comma separated addon names
1614
names string
17-
//The file to output the resources will be sent to the file.
18-
outputFile string
19-
values scenario.Values
20-
bundleVersion string
15+
// The namespace in which to install the hub add-on(s)
16+
namespace string
17+
// Whether to create the hub add-on namespace during install
18+
createNamespace bool
2119
// The chart version to use when deploying the hub add-on(s)
2220
chartVersion string
2321

pkg/cmd/uninstall/hubaddon/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, stream
4949
}
5050

5151
cmd.Flags().StringVar(&o.names, "names", "", "Names of the built-in add-on to uninstall (comma separated). The built-in add-ons are: argocd, argocd-agent, governance-policy-framework")
52-
cmd.Flags().StringVar(&o.values.Namespace, "namespace", "open-cluster-management", "Namespace of the built-in add-on to uninstall. Defaults to open-cluster-management")
52+
cmd.Flags().StringVar(&o.namespace, "namespace", "", "Namespace from which to uninstall the add-ons. If not provided, the add-ons will be uninstalled according to their chart.")
5353

5454
return cmd
5555
}

pkg/cmd/uninstall/hubaddon/options.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package hubaddon
33

44
import (
55
"k8s.io/cli-runtime/pkg/genericiooptions"
6-
7-
"open-cluster-management.io/clusteradm/pkg/cmd/install/hubaddon/scenario"
86
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions"
97
"open-cluster-management.io/clusteradm/pkg/helpers/helm"
108
)
@@ -14,8 +12,8 @@ type Options struct {
1412
ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags
1513
//A list of comma separated addon names
1614
names string
17-
//The file to output the resources will be sent to the file.
18-
values scenario.Values
15+
//The namespace from which to uninstall the hub add-on(s)
16+
namespace string
1917

2018
Streams genericiooptions.IOStreams
2119

0 commit comments

Comments
 (0)