diff --git a/cmd/clusteradm/clusteradm.go b/cmd/clusteradm/clusteradm.go index a5e2058cf..3768c18c5 100644 --- a/cmd/clusteradm/clusteradm.go +++ b/cmd/clusteradm/clusteradm.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" "k8s.io/client-go/tools/clientcmd" cliflag "k8s.io/component-base/cli/flag" @@ -75,7 +76,7 @@ func main() { f := cmdutil.NewFactory(matchVersionKubeConfigFlags) root.SetGlobalNormalizationFunc(cliflag.WarnWordSepNormalizeFunc) - streams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} + streams := genericiooptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} clusteradmFlags := genericclioptionsclusteradm.NewClusteradmFlags(f) clusteradmFlags.AddFlags(flags) diff --git a/pkg/cmd/accept/cmd.go b/pkg/cmd/accept/cmd.go index 2cb046740..41858aa66 100644 --- a/pkg/cmd/accept/cmd.go +++ b/pkg/cmd/accept/cmd.go @@ -8,7 +8,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -19,7 +19,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/accept/options.go b/pkg/cmd/accept/options.go index d15ccd29f..bd71a8b71 100644 --- a/pkg/cmd/accept/options.go +++ b/pkg/cmd/accept/options.go @@ -2,7 +2,7 @@ package accept import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -20,7 +20,7 @@ type Options struct { Requesters []string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } // Values used in the template @@ -28,7 +28,7 @@ type Values struct { Clusters []string } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, ClusterOptions: genericclioptionsclusteradm.NewClusterOption(), diff --git a/pkg/cmd/addon/cmd.go b/pkg/cmd/addon/cmd.go index 06ac1c1fb..49d0ce42f 100644 --- a/pkg/cmd/addon/cmd.go +++ b/pkg/cmd/addon/cmd.go @@ -3,7 +3,7 @@ package addon import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/addon/create" "open-cluster-management.io/clusteradm/pkg/cmd/addon/disable" "open-cluster-management.io/clusteradm/pkg/cmd/addon/enable" @@ -11,7 +11,7 @@ import ( ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "addon", Short: "addon options", diff --git a/pkg/cmd/addon/create/cmd.go b/pkg/cmd/addon/create/cmd.go index b760bde55..302c69fa4 100644 --- a/pkg/cmd/addon/create/cmd.go +++ b/pkg/cmd/addon/create/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ Create an addon from manifests by using AddonTemplate ` // NewCmd creates a cammand to create an addon -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/addon/create/options.go b/pkg/cmd/addon/create/options.go index 21a3a5794..5debdddb2 100644 --- a/pkg/cmd/addon/create/options.go +++ b/pkg/cmd/addon/create/options.go @@ -3,6 +3,7 @@ package create import ( "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/utils/ptr" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -25,10 +26,10 @@ type Options struct { FileNameFlags genericclioptions.FileNameFlags // - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/addon/disable/cmd.go b/pkg/cmd/addon/disable/cmd.go index 2549ffad2..802830a4f 100644 --- a/pkg/cmd/addon/disable/cmd.go +++ b/pkg/cmd/addon/disable/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -37,7 +37,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/addon/disable/exec_test.go b/pkg/cmd/addon/disable/exec_test.go index 088e41008..f4bfcfd71 100644 --- a/pkg/cmd/addon/disable/exec_test.go +++ b/pkg/cmd/addon/disable/exec_test.go @@ -11,7 +11,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" clusterapiv1 "open-cluster-management.io/api/cluster/v1" @@ -51,7 +51,7 @@ var _ = ginkgo.Describe("addon disable", func() { gomega.Expect(err).ToNot(gomega.HaveOccurred(), "creat cluster error") } - streams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} + streams := genericiooptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} assertEnableAddon := func(addons []string, clusters []string, o *enable.Options) { ns := o.Namespace diff --git a/pkg/cmd/addon/disable/options.go b/pkg/cmd/addon/disable/options.go index d790d3e61..9075a698b 100644 --- a/pkg/cmd/addon/disable/options.go +++ b/pkg/cmd/addon/disable/options.go @@ -2,7 +2,7 @@ package disable import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -15,10 +15,10 @@ type Options struct { //The specified namespace for addon to disable Namespace string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/addon/enable/cmd.go b/pkg/cmd/addon/enable/cmd.go index 57756eead..959eb55b0 100644 --- a/pkg/cmd/addon/enable/cmd.go +++ b/pkg/cmd/addon/enable/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -35,7 +35,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/addon/enable/exec_test.go b/pkg/cmd/addon/enable/exec_test.go index 0a2a52283..6ed4fbe98 100644 --- a/pkg/cmd/addon/enable/exec_test.go +++ b/pkg/cmd/addon/enable/exec_test.go @@ -12,7 +12,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1" clusterapiv1 "open-cluster-management.io/api/cluster/v1" @@ -91,7 +91,7 @@ var _ = ginkgo.Describe("addon enable", func() { gomega.Expect(err).ToNot(gomega.HaveOccurred()) } - streams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} + streams := genericiooptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} // Generate entries for the `runWithClient` test table addonTests := []ginkgo.TableEntry{} diff --git a/pkg/cmd/addon/enable/options.go b/pkg/cmd/addon/enable/options.go index c7439b78b..e7297442d 100644 --- a/pkg/cmd/addon/enable/options.go +++ b/pkg/cmd/addon/enable/options.go @@ -2,7 +2,7 @@ package enable import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -20,10 +20,10 @@ type Options struct { //Annotations to add to the addon Annotate []string // - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/clean/cmd.go b/pkg/cmd/clean/cmd.go index 28f7a97fe..3b333fe02 100644 --- a/pkg/cmd/clean/cmd.go +++ b/pkg/cmd/clean/cmd.go @@ -8,7 +8,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -18,7 +18,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/clean/options.go b/pkg/cmd/clean/options.go index 0c146ad44..fe81abc4f 100644 --- a/pkg/cmd/clean/options.go +++ b/pkg/cmd/clean/options.go @@ -3,7 +3,7 @@ package init import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -19,7 +19,7 @@ type Options struct { //Delete the operator by default purgeOperator bool - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } // Values: The values used in the template @@ -36,7 +36,7 @@ type Hub struct { TokenSecret string `json:"tokenSecret"` } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/clusterset/bind/cmd.go b/pkg/cmd/clusterset/bind/cmd.go index 6d3bdfaf0..16cb5cb12 100644 --- a/pkg/cmd/clusterset/bind/cmd.go +++ b/pkg/cmd/clusterset/bind/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/clusterset/bind/options.go b/pkg/cmd/clusterset/bind/options.go index 8e6359069..613110a71 100644 --- a/pkg/cmd/clusterset/bind/options.go +++ b/pkg/cmd/clusterset/bind/options.go @@ -2,7 +2,7 @@ package bind import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -10,14 +10,14 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Clusterset string Namespace string } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/clusterset/cmd.go b/pkg/cmd/clusterset/cmd.go index 45c6faef9..85faf9548 100644 --- a/pkg/cmd/clusterset/cmd.go +++ b/pkg/cmd/clusterset/cmd.go @@ -3,7 +3,7 @@ package clusterset import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/clusterset/bind" "open-cluster-management.io/clusteradm/pkg/cmd/clusterset/set" "open-cluster-management.io/clusteradm/pkg/cmd/clusterset/unbind" @@ -11,7 +11,7 @@ import ( ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "clusterset", Short: "clusterset options", diff --git a/pkg/cmd/clusterset/set/cmd.go b/pkg/cmd/clusterset/set/cmd.go index e5a26c1be..b0679d4bb 100644 --- a/pkg/cmd/clusterset/set/cmd.go +++ b/pkg/cmd/clusterset/set/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/clusterset/set/options.go b/pkg/cmd/clusterset/set/options.go index 606ec1000..9cf31d85a 100644 --- a/pkg/cmd/clusterset/set/options.go +++ b/pkg/cmd/clusterset/set/options.go @@ -2,7 +2,7 @@ package set import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -10,14 +10,14 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Clusters []string Clusterset string } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/clusterset/unbind/cmd.go b/pkg/cmd/clusterset/unbind/cmd.go index e1781c3a6..f2d8b8d59 100644 --- a/pkg/cmd/clusterset/unbind/cmd.go +++ b/pkg/cmd/clusterset/unbind/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/clusterset/unbind/options.go b/pkg/cmd/clusterset/unbind/options.go index 6f3a1026a..2bf3fde44 100644 --- a/pkg/cmd/clusterset/unbind/options.go +++ b/pkg/cmd/clusterset/unbind/options.go @@ -2,7 +2,7 @@ package unbind import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -10,14 +10,14 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Clusterset string Namespace string } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/create/clusterset/cmd.go b/pkg/cmd/create/clusterset/cmd.go index 8383bda5f..df4fa15c7 100644 --- a/pkg/cmd/create/clusterset/cmd.go +++ b/pkg/cmd/create/clusterset/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/create/clusterset/options.go b/pkg/cmd/create/clusterset/options.go index d659ac9e5..60f9e2808 100644 --- a/pkg/cmd/create/clusterset/options.go +++ b/pkg/cmd/create/clusterset/options.go @@ -2,7 +2,7 @@ package clusterset import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -10,12 +10,12 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Clustersets []string } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/create/cmd.go b/pkg/cmd/create/cmd.go index f38c762b5..39494d670 100644 --- a/pkg/cmd/create/cmd.go +++ b/pkg/cmd/create/cmd.go @@ -3,7 +3,7 @@ package create import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/create/clusterset" "open-cluster-management.io/clusteradm/pkg/cmd/create/placement" "open-cluster-management.io/clusteradm/pkg/cmd/create/sampleapp" @@ -12,7 +12,7 @@ import ( ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "create", Short: "create a resource", diff --git a/pkg/cmd/create/placement/cmd.go b/pkg/cmd/create/placement/cmd.go index a8d9b4a22..8cb575b3b 100644 --- a/pkg/cmd/create/placement/cmd.go +++ b/pkg/cmd/create/placement/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -26,7 +26,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/create/placement/options.go b/pkg/cmd/create/placement/options.go index 7533d7668..2b77c4911 100644 --- a/pkg/cmd/create/placement/options.go +++ b/pkg/cmd/create/placement/options.go @@ -3,7 +3,7 @@ package placement import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -11,7 +11,7 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Namespace string @@ -30,7 +30,7 @@ type Options struct { Overwrite bool } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/create/sampleapp/cmd.go b/pkg/cmd/create/sampleapp/cmd.go index 1cfa2b52e..d55a6de0c 100644 --- a/pkg/cmd/create/sampleapp/cmd.go +++ b/pkg/cmd/create/sampleapp/cmd.go @@ -9,7 +9,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -20,7 +20,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := NewOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/create/sampleapp/exec_test.go b/pkg/cmd/create/sampleapp/exec_test.go index 2452684b4..589645b71 100644 --- a/pkg/cmd/create/sampleapp/exec_test.go +++ b/pkg/cmd/create/sampleapp/exec_test.go @@ -17,7 +17,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" clusterapiv1 "open-cluster-management.io/api/cluster/v1" "open-cluster-management.io/clusteradm/pkg/cmd/addon/enable" @@ -101,7 +101,7 @@ var _ = ginkgo.Describe("deploy samepleapp to every managed cluster", func() { gomega.Expect(err).ToNot(gomega.HaveOccurred()) } - streams := genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} + streams := genericiooptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr} addonPathWalkDir := func(root string) ([]string, error) { var files []string @@ -149,7 +149,7 @@ var _ = ginkgo.Describe("deploy samepleapp to every managed cluster", func() { gomega.Expect(err).ToNot(gomega.HaveOccurred()) f := cmdutil.NewFactory(TestClientGetter{cfg: restConfig}) - r := reader.NewResourceReader(f, false, genericclioptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}) + r := reader.NewResourceReader(f, false, genericiooptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}) mydir, err := os.Getwd() gomega.Expect(err).ToNot(gomega.HaveOccurred(), "install addon error") diff --git a/pkg/cmd/create/sampleapp/options.go b/pkg/cmd/create/sampleapp/options.go index fdec0aa9d..3001aa21d 100644 --- a/pkg/cmd/create/sampleapp/options.go +++ b/pkg/cmd/create/sampleapp/options.go @@ -3,7 +3,7 @@ package sampleapp import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -12,7 +12,7 @@ type Options struct { ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags // - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams // The base name for the resources created for this sample app SampleAppName string @@ -24,7 +24,7 @@ type Options struct { OutputFile string } -func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func NewOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/create/work/cmd.go b/pkg/cmd/create/work/cmd.go index 8cdc6479f..71b7345ce 100644 --- a/pkg/cmd/create/work/cmd.go +++ b/pkg/cmd/create/work/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -30,7 +30,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/create/work/options.go b/pkg/cmd/create/work/options.go index 07f556765..258a289f0 100644 --- a/pkg/cmd/create/work/options.go +++ b/pkg/cmd/create/work/options.go @@ -3,6 +3,7 @@ package work import ( "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/utils/ptr" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -13,7 +14,7 @@ type Options struct { ClusterOption *genericclioptionsclusteradm.ClusterOption - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Placement string @@ -26,7 +27,7 @@ type Options struct { UseReplicaSet bool } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/delete/clusterset/cmd.go b/pkg/cmd/delete/clusterset/cmd.go index e30df8083..e4abf28bb 100644 --- a/pkg/cmd/delete/clusterset/cmd.go +++ b/pkg/cmd/delete/clusterset/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/delete/clusterset/options.go b/pkg/cmd/delete/clusterset/options.go index 15e6f1bdf..a6694e47d 100644 --- a/pkg/cmd/delete/clusterset/options.go +++ b/pkg/cmd/delete/clusterset/options.go @@ -2,7 +2,7 @@ package clusterset import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -10,12 +10,12 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Clustersets []string } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/delete/cmd.go b/pkg/cmd/delete/cmd.go index 6eee7da4e..c85738965 100644 --- a/pkg/cmd/delete/cmd.go +++ b/pkg/cmd/delete/cmd.go @@ -3,7 +3,7 @@ package get import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/delete/clusterset" "open-cluster-management.io/clusteradm/pkg/cmd/delete/token" "open-cluster-management.io/clusteradm/pkg/cmd/delete/work" @@ -11,7 +11,7 @@ import ( ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "delete", Short: "delete a resource", diff --git a/pkg/cmd/delete/token/cmd.go b/pkg/cmd/delete/token/cmd.go index 4c4c1ae02..2ce983d08 100644 --- a/pkg/cmd/delete/token/cmd.go +++ b/pkg/cmd/delete/token/cmd.go @@ -7,7 +7,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -17,7 +17,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/delete/token/options.go b/pkg/cmd/delete/token/options.go index 191098df8..19a19f312 100644 --- a/pkg/cmd/delete/token/options.go +++ b/pkg/cmd/delete/token/options.go @@ -2,7 +2,7 @@ package token import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -12,7 +12,7 @@ type Options struct { ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, } diff --git a/pkg/cmd/delete/work/cmd.go b/pkg/cmd/delete/work/cmd.go index d9d66a578..d6de1bdb0 100644 --- a/pkg/cmd/delete/work/cmd.go +++ b/pkg/cmd/delete/work/cmd.go @@ -7,7 +7,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -17,7 +17,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/delete/work/options.go b/pkg/cmd/delete/work/options.go index a31867828..1120ac2d3 100644 --- a/pkg/cmd/delete/work/options.go +++ b/pkg/cmd/delete/work/options.go @@ -2,7 +2,7 @@ package work import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -13,14 +13,14 @@ type Options struct { ClusterOptions *genericclioptionsclusteradm.ClusterOption - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Workname string Force bool } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/addon/cmd.go b/pkg/cmd/get/addon/cmd.go index 43ed9c3de..721d3751c 100644 --- a/pkg/cmd/get/addon/cmd.go +++ b/pkg/cmd/get/addon/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -19,7 +19,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/addon/options.go b/pkg/cmd/get/addon/options.go index 9ccc1ee42..70a95bff8 100644 --- a/pkg/cmd/get/addon/options.go +++ b/pkg/cmd/get/addon/options.go @@ -3,7 +3,7 @@ package addon import ( "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/printers" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers/printer" @@ -16,12 +16,12 @@ type Options struct { // A list of addon name to show addons []string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams printer *printer.PrinterOption } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, ClusterOptions: genericclioptionsclusteradm.NewClusterOption().AllowUnset(), diff --git a/pkg/cmd/get/cluster/cmd.go b/pkg/cmd/get/cluster/cmd.go index b19fa098e..61178f28b 100644 --- a/pkg/cmd/get/cluster/cmd.go +++ b/pkg/cmd/get/cluster/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -19,7 +19,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/cluster/options.go b/pkg/cmd/get/cluster/options.go index 6cfab6634..426a7147d 100644 --- a/pkg/cmd/get/cluster/options.go +++ b/pkg/cmd/get/cluster/options.go @@ -3,7 +3,7 @@ package cluster import ( "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/printers" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers/printer" @@ -15,12 +15,12 @@ type Options struct { //Clusterset of the clusters Clusterset string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams printer *printer.PrinterOption } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/clusterset/cmd.go b/pkg/cmd/get/clusterset/cmd.go index 6295ab024..39fee7c40 100644 --- a/pkg/cmd/get/clusterset/cmd.go +++ b/pkg/cmd/get/clusterset/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/clusterset/options.go b/pkg/cmd/get/clusterset/options.go index 18c11c686..f7dde90d7 100644 --- a/pkg/cmd/get/clusterset/options.go +++ b/pkg/cmd/get/clusterset/options.go @@ -3,7 +3,7 @@ package clusterset import ( "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/printers" clusterclientset "open-cluster-management.io/api/client/cluster/clientset/versioned" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" @@ -14,14 +14,14 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams printer *printer.PrinterOption Client *clusterclientset.Clientset } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/cmd.go b/pkg/cmd/get/cmd.go index dea4a68ed..db45e148e 100644 --- a/pkg/cmd/get/cmd.go +++ b/pkg/cmd/get/cmd.go @@ -3,7 +3,7 @@ package get import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/get/addon" "open-cluster-management.io/clusteradm/pkg/cmd/get/cluster" "open-cluster-management.io/clusteradm/pkg/cmd/get/clusterset" @@ -16,7 +16,7 @@ import ( ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "get", Short: "get information from the cluster", diff --git a/pkg/cmd/get/hubinfo/cmd.go b/pkg/cmd/get/hubinfo/cmd.go index 6dd82b246..750e986f6 100644 --- a/pkg/cmd/get/hubinfo/cmd.go +++ b/pkg/cmd/get/hubinfo/cmd.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" ) @@ -16,7 +16,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/hubinfo/options.go b/pkg/cmd/get/hubinfo/options.go index 7421ebd1c..9f9716b74 100644 --- a/pkg/cmd/get/hubinfo/options.go +++ b/pkg/cmd/get/hubinfo/options.go @@ -3,7 +3,7 @@ package hubinfo import ( "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/kubernetes" operatorclient "open-cluster-management.io/api/client/operator/clientset/versioned" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" @@ -14,7 +14,7 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams printer printer.PrefixWriter operatorClient operatorclient.Interface @@ -22,7 +22,7 @@ type Options struct { crdClient clientset.Interface } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/klusterletinfo/cmd.go b/pkg/cmd/get/klusterletinfo/cmd.go index b11bf157d..4c24a4cf3 100644 --- a/pkg/cmd/get/klusterletinfo/cmd.go +++ b/pkg/cmd/get/klusterletinfo/cmd.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" ) @@ -16,7 +16,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/klusterletinfo/options.go b/pkg/cmd/get/klusterletinfo/options.go index f1f7b3722..29ccc469d 100644 --- a/pkg/cmd/get/klusterletinfo/options.go +++ b/pkg/cmd/get/klusterletinfo/options.go @@ -3,7 +3,7 @@ package klusterletinfo import ( "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/kubernetes" operatorclient "open-cluster-management.io/api/client/operator/clientset/versioned" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" @@ -14,7 +14,7 @@ type Options struct { //ClusteradmFlags: The generic options from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams printer printer.PrefixWriter operatorClient operatorclient.Interface @@ -22,7 +22,7 @@ type Options struct { crdClient clientset.Interface } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/placement/cmd.go b/pkg/cmd/get/placement/cmd.go index ae6406eea..03d50510b 100644 --- a/pkg/cmd/get/placement/cmd.go +++ b/pkg/cmd/get/placement/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/placement/options.go b/pkg/cmd/get/placement/options.go index eb0580664..4a1fd08f1 100644 --- a/pkg/cmd/get/placement/options.go +++ b/pkg/cmd/get/placement/options.go @@ -3,7 +3,7 @@ package placement import ( "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/printers" clusterv1beta1 "open-cluster-management.io/api/client/cluster/clientset/versioned/typed/cluster/v1beta1" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" @@ -13,7 +13,7 @@ import ( type Options struct { //ClusteradmFlags: The generic optiosn from the clusteradm cli-runtime. ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams Client *clusterv1beta1.ClusterV1beta1Client PlacementName string Namespace string @@ -21,7 +21,7 @@ type Options struct { printer *printer.PrinterOption } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/token/cmd.go b/pkg/cmd/get/token/cmd.go index def54e748..618c64039 100644 --- a/pkg/cmd/get/token/cmd.go +++ b/pkg/cmd/get/token/cmd.go @@ -7,7 +7,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -17,7 +17,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/token/options.go b/pkg/cmd/get/token/options.go index 4bb56ebe4..4c856f11a 100644 --- a/pkg/cmd/get/token/options.go +++ b/pkg/cmd/get/token/options.go @@ -2,7 +2,7 @@ package token import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -18,7 +18,7 @@ type Options struct { //output format output string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } // Values: The values used in the template @@ -35,7 +35,7 @@ type Hub struct { TokenSecret string `json:"tokenSecret"` } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/get/work/cmd.go b/pkg/cmd/get/work/cmd.go index 45e2d7880..e9506f59c 100644 --- a/pkg/cmd/get/work/cmd.go +++ b/pkg/cmd/get/work/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -19,7 +19,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/get/work/options.go b/pkg/cmd/get/work/options.go index 8d009520f..62ce2663c 100644 --- a/pkg/cmd/get/work/options.go +++ b/pkg/cmd/get/work/options.go @@ -3,7 +3,7 @@ package work import ( "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/printers" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers/printer" @@ -17,12 +17,12 @@ type Options struct { workName string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams printer *printer.PrinterOption } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/init/cmd.go b/pkg/cmd/init/cmd.go index 1cc68a3f1..cce10e701 100644 --- a/pkg/cmd/init/cmd.go +++ b/pkg/cmd/init/cmd.go @@ -6,7 +6,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers" ) @@ -17,7 +17,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/init/options.go b/pkg/cmd/init/options.go index f900223a4..6a98770fe 100644 --- a/pkg/cmd/init/options.go +++ b/pkg/cmd/init/options.go @@ -2,7 +2,7 @@ package init import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers/helm" "open-cluster-management.io/ocm/pkg/operator/helpers/chart" @@ -49,10 +49,10 @@ type Options struct { // output string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, clusterManagerChartConfig: chart.NewDefaultClusterManagerChartConfig(), diff --git a/pkg/cmd/install/cmd.go b/pkg/cmd/install/cmd.go index 2eece412f..a85575939 100644 --- a/pkg/cmd/install/cmd.go +++ b/pkg/cmd/install/cmd.go @@ -3,13 +3,13 @@ package install import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" hubaddon "open-cluster-management.io/clusteradm/pkg/cmd/install/hubaddon" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) // NewCmd provides a cobra command wrapping addon install cmd -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "install", Short: "install a feature", diff --git a/pkg/cmd/install/hubaddon/cmd.go b/pkg/cmd/install/hubaddon/cmd.go index 744496f69..254790fdb 100644 --- a/pkg/cmd/install/hubaddon/cmd.go +++ b/pkg/cmd/install/hubaddon/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -18,7 +18,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/install/hubaddon/exec_test.go b/pkg/cmd/install/hubaddon/exec_test.go index d20085334..7ec232d11 100644 --- a/pkg/cmd/install/hubaddon/exec_test.go +++ b/pkg/cmd/install/hubaddon/exec_test.go @@ -9,7 +9,7 @@ import ( "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/install/hubaddon/scenario" "open-cluster-management.io/clusteradm/pkg/version" ) @@ -103,7 +103,7 @@ var _ = ginkgo.Describe("install hub-addon", func() { Namespace: invalidNamespace, HubAddons: []string{scenario.AppMgrAddonName}, }, - Streams: genericclioptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}, + Streams: genericiooptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}, } err := o.runWithClient() @@ -128,7 +128,7 @@ var _ = ginkgo.Describe("install hub-addon", func() { HubAddons: []string{hubAddon}, BundleVersion: ocmBundleVersion, }, - Streams: genericclioptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}, + Streams: genericiooptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}, } err := o.runWithClient() diff --git a/pkg/cmd/install/hubaddon/options.go b/pkg/cmd/install/hubaddon/options.go index d3005353f..71d974178 100644 --- a/pkg/cmd/install/hubaddon/options.go +++ b/pkg/cmd/install/hubaddon/options.go @@ -2,7 +2,7 @@ package hubaddon import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/install/hubaddon/scenario" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -17,10 +17,10 @@ type Options struct { values scenario.Values bundleVersion string - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/join/cmd.go b/pkg/cmd/join/cmd.go index 76766f34f..925093852 100644 --- a/pkg/cmd/join/cmd.go +++ b/pkg/cmd/join/cmd.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers" ) @@ -20,7 +20,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/join/options.go b/pkg/cmd/join/options.go index 3c7e3bc65..114460c25 100644 --- a/pkg/cmd/join/options.go +++ b/pkg/cmd/join/options.go @@ -2,7 +2,7 @@ package join import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" clientcmdapiv1 "k8s.io/client-go/tools/clientcmd/api/v1" "open-cluster-management.io/clusteradm/pkg/clusterprovider/capi" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" @@ -80,7 +80,7 @@ type Options struct { capiOptions *capi.CAPIOptions - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams // enableSyncLabels is to enable the feature which can sync the labels from klusterlet to all agent resources. enableSyncLabels bool @@ -88,7 +88,7 @@ type Options struct { clientCertExpirationSeconds int32 } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/proxy/cmd.go b/pkg/cmd/proxy/cmd.go index ed625b224..4765ffd13 100644 --- a/pkg/cmd/proxy/cmd.go +++ b/pkg/cmd/proxy/cmd.go @@ -3,14 +3,14 @@ package proxy import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/proxy/health" "open-cluster-management.io/clusteradm/pkg/cmd/proxy/kubectl" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "proxy", diff --git a/pkg/cmd/proxy/health/cmd.go b/pkg/cmd/proxy/health/cmd.go index 41aece728..882d59835 100644 --- a/pkg/cmd/proxy/health/cmd.go +++ b/pkg/cmd/proxy/health/cmd.go @@ -8,7 +8,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -21,7 +21,7 @@ const ( ) // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/proxy/health/exec.go b/pkg/cmd/proxy/health/exec.go index c45126a79..eab5b1f5b 100644 --- a/pkg/cmd/proxy/health/exec.go +++ b/pkg/cmd/proxy/health/exec.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8snet "k8s.io/apimachinery/pkg/util/net" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/klog/v2" @@ -68,7 +68,7 @@ func (o *Options) validate() error { return nil } -func (o *Options) run(streams genericclioptions.IOStreams) error { +func (o *Options) run(streams genericiooptions.IOStreams) error { hubRestConfig, err := o.ClusteradmFlags.KubectlFactory.ToRESTConfig() if err != nil { @@ -317,7 +317,7 @@ type writer struct { w *tabwriter.Writer } -func newWriter(streams genericclioptions.IOStreams) writer { +func newWriter(streams genericiooptions.IOStreams) writer { w := tabwriter.NewWriter(streams.Out, 4, 8, 4, ' ', 0) // header _, _ = fmt.Fprintf(w, diff --git a/pkg/cmd/proxy/health/options.go b/pkg/cmd/proxy/health/options.go index d8b0c2c66..f43775548 100644 --- a/pkg/cmd/proxy/health/options.go +++ b/pkg/cmd/proxy/health/options.go @@ -2,7 +2,7 @@ package health import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -24,7 +24,7 @@ type Options struct { isProxyServerAddressProvided bool } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, ClusterOption: genericclioptionsclusteradm.NewClusterOption().AllowUnset(), diff --git a/pkg/cmd/proxy/kubectl/cmd.go b/pkg/cmd/proxy/kubectl/cmd.go index 49adbf39e..27c1e0c35 100644 --- a/pkg/cmd/proxy/kubectl/cmd.go +++ b/pkg/cmd/proxy/kubectl/cmd.go @@ -16,7 +16,7 @@ import ( "github.com/spf13/cobra" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" @@ -33,7 +33,7 @@ import ( msaclientset "open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned" ) -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags) var hubRestConfig *rest.Config @@ -179,7 +179,7 @@ func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, stream return cmd } -func getProxyConfig(hubRestConfig *rest.Config, streams genericclioptions.IOStreams) (*proxyv1alpha1.ManagedProxyConfiguration, error) { +func getProxyConfig(hubRestConfig *rest.Config, streams genericiooptions.IOStreams) (*proxyv1alpha1.ManagedProxyConfiguration, error) { addonClient, err := addonv1alpha1client.NewForConfig(hubRestConfig) if err != nil { return nil, errors.Wrapf(err, "failed initializing addon api client") diff --git a/pkg/cmd/uninstall/cmd.go b/pkg/cmd/uninstall/cmd.go index f42f4f724..8f4428179 100644 --- a/pkg/cmd/uninstall/cmd.go +++ b/pkg/cmd/uninstall/cmd.go @@ -3,13 +3,13 @@ package uninstall import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/uninstall/hubaddon" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) // NewCmd provides a cobra command wrapping addon uninstall cmd -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "uninstall", Short: "uninstall a feature", diff --git a/pkg/cmd/uninstall/hubaddon/cmd.go b/pkg/cmd/uninstall/hubaddon/cmd.go index 14ee024e5..4ffc518f5 100644 --- a/pkg/cmd/uninstall/hubaddon/cmd.go +++ b/pkg/cmd/uninstall/hubaddon/cmd.go @@ -8,7 +8,7 @@ import ( clusteradmhelpers "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -18,7 +18,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/uninstall/hubaddon/options.go b/pkg/cmd/uninstall/hubaddon/options.go index 87bf2d8eb..1b7f52d60 100644 --- a/pkg/cmd/uninstall/hubaddon/options.go +++ b/pkg/cmd/uninstall/hubaddon/options.go @@ -2,7 +2,7 @@ package hubaddon import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/install/hubaddon/scenario" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -15,10 +15,10 @@ type Options struct { //The file to output the resources will be sent to the file. values scenario.Values - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/unjoin/cmd.go b/pkg/cmd/unjoin/cmd.go index 23129cd95..166a57e79 100644 --- a/pkg/cmd/unjoin/cmd.go +++ b/pkg/cmd/unjoin/cmd.go @@ -8,7 +8,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/unjoin/options.go b/pkg/cmd/unjoin/options.go index 949067adb..9b1951da0 100644 --- a/pkg/cmd/unjoin/options.go +++ b/pkg/cmd/unjoin/options.go @@ -2,7 +2,7 @@ package unjoin import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" operatorv1 "open-cluster-management.io/api/operator/v1" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -19,7 +19,7 @@ type Options struct { outputFile string values Values - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } type Values struct { //ClusterName: the name of the joined cluster on the hub @@ -30,7 +30,7 @@ type Values struct { AgentNamespace string } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/upgrade/clustermanager/cmd.go b/pkg/cmd/upgrade/clustermanager/cmd.go index ad44afade..042c48626 100644 --- a/pkg/cmd/upgrade/clustermanager/cmd.go +++ b/pkg/cmd/upgrade/clustermanager/cmd.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers" ) @@ -16,7 +16,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/upgrade/clustermanager/options.go b/pkg/cmd/upgrade/clustermanager/options.go index 5ee7d786f..eb24e2cbe 100644 --- a/pkg/cmd/upgrade/clustermanager/options.go +++ b/pkg/cmd/upgrade/clustermanager/options.go @@ -2,7 +2,7 @@ package clustermanager import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/ocm/pkg/operator/helpers/chart" ) @@ -20,10 +20,10 @@ type Options struct { //If set, the command will hold until the OCM control plane initialized wait bool - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/upgrade/cmd.go b/pkg/cmd/upgrade/cmd.go index 9b420b55d..f8a7d0dd2 100644 --- a/pkg/cmd/upgrade/cmd.go +++ b/pkg/cmd/upgrade/cmd.go @@ -3,14 +3,14 @@ package upgrade import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "open-cluster-management.io/clusteradm/pkg/cmd/upgrade/clustermanager" "open-cluster-management.io/clusteradm/pkg/cmd/upgrade/klusterlet" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) // NewCmd provides a cobra command wrapping NewCmdImportCluster -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { cmd := &cobra.Command{ Use: "upgrade", Short: "upgrade component", diff --git a/pkg/cmd/upgrade/klusterlet/cmd.go b/pkg/cmd/upgrade/klusterlet/cmd.go index 1064cc259..17df93e79 100644 --- a/pkg/cmd/upgrade/klusterlet/cmd.go +++ b/pkg/cmd/upgrade/klusterlet/cmd.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/clusteradm/pkg/helpers" ) @@ -16,7 +16,7 @@ var example = ` ` // NewCmd ... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ diff --git a/pkg/cmd/upgrade/klusterlet/options.go b/pkg/cmd/upgrade/klusterlet/options.go index 8a78b4eec..6d2103296 100644 --- a/pkg/cmd/upgrade/klusterlet/options.go +++ b/pkg/cmd/upgrade/klusterlet/options.go @@ -2,7 +2,7 @@ package klusterlet import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" "open-cluster-management.io/ocm/pkg/operator/helpers/chart" ) @@ -21,10 +21,10 @@ type Options struct { //If set, the command will hold until the OCM control plane initialized wait bool - Streams genericclioptions.IOStreams + Streams genericiooptions.IOStreams } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, Streams: streams, diff --git a/pkg/cmd/version/cmd.go b/pkg/cmd/version/cmd.go index fa639a261..e253616a4 100644 --- a/pkg/cmd/version/cmd.go +++ b/pkg/cmd/version/cmd.go @@ -8,7 +8,7 @@ import ( "open-cluster-management.io/clusteradm/pkg/helpers" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var example = ` @@ -17,7 +17,7 @@ var example = ` ` // NewCmd... -func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *cobra.Command { +func NewCmd(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *cobra.Command { o := newOptions(clusteradmFlags, streams) cmd := &cobra.Command{ Use: "version", diff --git a/pkg/cmd/version/options.go b/pkg/cmd/version/options.go index 44563178b..00141afa3 100644 --- a/pkg/cmd/version/options.go +++ b/pkg/cmd/version/options.go @@ -2,7 +2,7 @@ package version import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions" ) @@ -11,7 +11,7 @@ type Options struct { ClusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags } -func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericclioptions.IOStreams) *Options { +func newOptions(clusteradmFlags *genericclioptionsclusteradm.ClusteradmFlags, streams genericiooptions.IOStreams) *Options { return &Options{ ClusteradmFlags: clusteradmFlags, } diff --git a/pkg/helpers/printer/option.go b/pkg/helpers/printer/option.go index e8b379302..f329e0167 100644 --- a/pkg/helpers/printer/option.go +++ b/pkg/helpers/printer/option.go @@ -8,7 +8,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/printers" ) @@ -55,7 +55,7 @@ func (p *PrinterOption) WithTableConverter(f func(runtime.Object) *metav1.Table) return p } -func (p *PrinterOption) Print(stream genericclioptions.IOStreams, obj runtime.Object) error { +func (p *PrinterOption) Print(stream genericiooptions.IOStreams, obj runtime.Object) error { switch p.Format { case "tree": p.tree = *p.treeConverter(obj, &p.tree) diff --git a/pkg/helpers/reader/reader.go b/pkg/helpers/reader/reader.go index 0b679ab9b..08bba3e5b 100644 --- a/pkg/helpers/reader/reader.go +++ b/pkg/helpers/reader/reader.go @@ -14,7 +14,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" utilerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/resource" "k8s.io/kubectl/pkg/cmd/apply" cmdutil "k8s.io/kubectl/pkg/cmd/util" @@ -26,12 +26,12 @@ const yamlSeparator = "\n---\n" type ResourceReader struct { builder *resource.Builder dryRun bool - streams genericclioptions.IOStreams + streams genericiooptions.IOStreams raw []byte f cmdutil.Factory } -func NewResourceReader(f cmdutil.Factory, dryRun bool, streams genericclioptions.IOStreams) *ResourceReader { +func NewResourceReader(f cmdutil.Factory, dryRun bool, streams genericiooptions.IOStreams) *ResourceReader { return &ResourceReader{ builder: f.NewBuilder().Unstructured(), dryRun: dryRun, diff --git a/test/e2e/clusteradm/joinhubscenario_skip_approve_test.go b/test/e2e/clusteradm/joinhubscenario_skip_approve_test.go index 087f3c90d..8e26e6832 100644 --- a/test/e2e/clusteradm/joinhubscenario_skip_approve_test.go +++ b/test/e2e/clusteradm/joinhubscenario_skip_approve_test.go @@ -6,13 +6,14 @@ import ( "os" "time" + "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" authv1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/utils/ptr" "open-cluster-management.io/clusteradm/pkg/config" "open-cluster-management.io/clusteradm/pkg/helpers/reader" @@ -50,7 +51,7 @@ var _ = ginkgo.Describe("test clusteradm with manual bootstrap token", func() { KubeConfig: ptr.To[string](e2e.Kubeconfigpath), Context: ptr.To[string](e2e.Cluster().Hub().Context()), } - r := reader.NewResourceReader(cmdutil.NewFactory(kubeConfigFlags), false, genericclioptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}) + r := reader.NewResourceReader(cmdutil.NewFactory(kubeConfigFlags), false, genericiooptions.IOStreams{Out: os.Stdout, ErrOut: os.Stderr}) var values = make(map[string]interface{}) err = r.Apply(scenario.Files, values, files...) gomega.Expect(err).To(gomega.BeNil())