diff --git a/internal/kubernetes/kubernetes.go b/internal/kubernetes/kubernetes.go index 22643bf2e..5a2e0c738 100644 --- a/internal/kubernetes/kubernetes.go +++ b/internal/kubernetes/kubernetes.go @@ -33,7 +33,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" "k8s.io/kubectl/pkg/cmd/exec" @@ -89,7 +89,7 @@ func ExecuteCommandRaw( ContainerName: container, Stdin: stdin != nil, TTY: isTty, - IOStreams: genericclioptions.IOStreams{ + IOStreams: genericiooptions.IOStreams{ In: stdin, Out: stdout, ErrOut: stderr, diff --git a/kubectl-fdb/cmd/analyze.go b/kubectl-fdb/cmd/analyze.go index cc411632c..472592db7 100644 --- a/kubectl-fdb/cmd/analyze.go +++ b/kubectl-fdb/cmd/analyze.go @@ -36,13 +36,13 @@ import ( "github.com/fatih/color" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newAnalyzeCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newAnalyzeCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/buggify.go b/kubectl-fdb/cmd/buggify.go index 3f145402b..14b91c114 100644 --- a/kubectl-fdb/cmd/buggify.go +++ b/kubectl-fdb/cmd/buggify.go @@ -21,12 +21,12 @@ package cmd import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "github.com/spf13/cobra" ) -func newBuggifyCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newBuggifyCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/buggify_crash_loop.go b/kubectl-fdb/cmd/buggify_crash_loop.go index d5a285a7e..806bdcd39 100644 --- a/kubectl-fdb/cmd/buggify_crash_loop.go +++ b/kubectl-fdb/cmd/buggify_crash_loop.go @@ -27,11 +27,11 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" "github.com/spf13/cobra" k8serrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newBuggifyCrashLoop(streams genericclioptions.IOStreams) *cobra.Command { +func newBuggifyCrashLoop(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/buggify_crash_loop_test.go b/kubectl-fdb/cmd/buggify_crash_loop_test.go index ac2f9cd39..a96cd18cd 100644 --- a/kubectl-fdb/cmd/buggify_crash_loop_test.go +++ b/kubectl-fdb/cmd/buggify_crash_loop_test.go @@ -24,7 +24,7 @@ import ( "context" "fmt" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" . "github.com/onsi/ginkgo/v2" @@ -57,7 +57,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() { DescribeTable("should add all targeted process groups to crash-loop container list", func(tc processGroupOptionsTestCase) { Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(0)) - cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{}) + cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, @@ -229,7 +229,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() { DescribeTable("should add all targeted process groups to crash-loop container list", func(tc testCase) { Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1)) - cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{}) + cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, @@ -310,7 +310,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() { DescribeTable("should add all targeted processes to crash-loop container list", func(tc testCase) { Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1)) - cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{}) + cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, @@ -391,7 +391,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() { "should remove all targeted process groups from crash-loop container list", func(tc testCase) { Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1)) - cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{}) + cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, @@ -470,7 +470,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() { It("should clear everything from the crash-loop container-list", func() { Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1)) - cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{}) + cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, @@ -500,7 +500,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() { }) It("should error if no cluster name is provided", func() { Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1)) - cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{}) + cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, diff --git a/kubectl-fdb/cmd/buggify_empty_monitor_conf.go b/kubectl-fdb/cmd/buggify_empty_monitor_conf.go index 1c3766317..51b50ae0c 100644 --- a/kubectl-fdb/cmd/buggify_empty_monitor_conf.go +++ b/kubectl-fdb/cmd/buggify_empty_monitor_conf.go @@ -27,11 +27,11 @@ import ( "github.com/spf13/cobra" k8serrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newBuggifyEmptyMonitorConf(streams genericclioptions.IOStreams) *cobra.Command { +func newBuggifyEmptyMonitorConf(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/buggify_no_schedule.go b/kubectl-fdb/cmd/buggify_no_schedule.go index bb0573c71..79b7b8018 100644 --- a/kubectl-fdb/cmd/buggify_no_schedule.go +++ b/kubectl-fdb/cmd/buggify_no_schedule.go @@ -26,11 +26,11 @@ import ( "github.com/spf13/cobra" k8serrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newBuggifyNoSchedule(streams genericclioptions.IOStreams) *cobra.Command { +func newBuggifyNoSchedule(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/buggify_no_schedule_test.go b/kubectl-fdb/cmd/buggify_no_schedule_test.go index 4fd6f9f83..07fc127a6 100644 --- a/kubectl-fdb/cmd/buggify_no_schedule_test.go +++ b/kubectl-fdb/cmd/buggify_no_schedule_test.go @@ -27,7 +27,7 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -49,7 +49,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() { DescribeTable("should add all targeted processes to no-schedule list", func(tc processGroupOptionsTestCase) { - cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{}) + cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{}) tc.ProcessGroupOpts.namespace = namespace err := updateNoScheduleList( cmd, @@ -201,7 +201,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() { DescribeTable("should add all targeted processes to no-schedule list", func(tc testCase) { - cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{}) + cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{}) processGroupOpts := processGroupSelectionOptions{ ids: tc.Instances, clusterName: clusterName, @@ -272,7 +272,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() { DescribeTable("should remove all targeted processes from the no-schedule list", func(tc testCase) { - cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{}) + cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{}) processGroupOpts := processGroupSelectionOptions{ ids: tc.Instances, clusterName: clusterName, @@ -328,7 +328,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() { }) It("should clear the no-schedule list", func() { - cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{}) + cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{}) processGroupOpts := processGroupSelectionOptions{ clusterName: clusterName, namespace: namespace, @@ -350,7 +350,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() { Expect(len(resCluster.Spec.Buggify.NoSchedule)).To(Equal(0)) }) It("should error if no cluster name is provided", func() { - cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{}) + cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{}) opts := buggifyProcessGroupOptions{ containerName: fdbv1beta2.MainContainerName, wait: false, diff --git a/kubectl-fdb/cmd/configuration.go b/kubectl-fdb/cmd/configuration.go index 65b081439..3db4b608d 100644 --- a/kubectl-fdb/cmd/configuration.go +++ b/kubectl-fdb/cmd/configuration.go @@ -25,11 +25,11 @@ import ( "fmt" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newConfigurationCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newConfigurationCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/cordon.go b/kubectl-fdb/cmd/cordon.go index 75f882bcb..744e9e946 100644 --- a/kubectl-fdb/cmd/cordon.go +++ b/kubectl-fdb/cmd/cordon.go @@ -25,13 +25,13 @@ import ( "fmt" fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "github.com/spf13/cobra" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newCordonCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newCordonCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) var nodeSelectors map[string]string diff --git a/kubectl-fdb/cmd/cordon_test.go b/kubectl-fdb/cmd/cordon_test.go index 0250924f3..79cdc75c3 100644 --- a/kubectl-fdb/cmd/cordon_test.go +++ b/kubectl-fdb/cmd/cordon_test.go @@ -29,7 +29,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -57,7 +57,7 @@ var _ = Describe("[plugin] cordon command", func() { DescribeTable("should cordon all targeted processes", func(input testCase) { - cmd := newCordonCmd(genericclioptions.IOStreams{}) + cmd := newCordonCmd(genericiooptions.IOStreams{}) err := cordonNode( cmd, k8sClient, diff --git a/kubectl-fdb/cmd/deprecation.go b/kubectl-fdb/cmd/deprecation.go index 987f0eea7..7c4c02b65 100644 --- a/kubectl-fdb/cmd/deprecation.go +++ b/kubectl-fdb/cmd/deprecation.go @@ -30,12 +30,12 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" "github.com/FoundationDB/fdb-kubernetes-operator/v2/internal" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" ) -func newDeprecationCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newDeprecationCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/deprecation_test.go b/kubectl-fdb/cmd/deprecation_test.go index 6d8bd5dc7..a8aeec985 100644 --- a/kubectl-fdb/cmd/deprecation_test.go +++ b/kubectl-fdb/cmd/deprecation_test.go @@ -31,7 +31,7 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" . "github.com/onsi/ginkgo/v2" @@ -62,7 +62,7 @@ var _ = Describe("[plugin] deprecation command", func() { Expect(k8sClient.Create(context.TODO(), &tc.cluster)).NotTo(HaveOccurred()) cmd := newDeprecationCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, ) err := checkDeprecation( cmd, @@ -220,7 +220,7 @@ var _ = Describe("[plugin] deprecation command", func() { inBuffer := bytes.Buffer{} cmd = NewRootCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, &MockVersionChecker{}, ) }) diff --git a/kubectl-fdb/cmd/exclusion_status.go b/kubectl-fdb/cmd/exclusion_status.go index 5f1717828..1213887bb 100644 --- a/kubectl-fdb/cmd/exclusion_status.go +++ b/kubectl-fdb/cmd/exclusion_status.go @@ -32,11 +32,11 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" ) -func newExclusionStatusCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newExclusionStatusCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/exec.go b/kubectl-fdb/cmd/exec.go index b4ce1eaec..58825258f 100644 --- a/kubectl-fdb/cmd/exec.go +++ b/kubectl-fdb/cmd/exec.go @@ -26,12 +26,12 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" kubeHelper "github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/kubernetes" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newExecCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newExecCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/exec_test.go b/kubectl-fdb/cmd/exec_test.go index 06ac8714c..fd6c1d69a 100644 --- a/kubectl-fdb/cmd/exec_test.go +++ b/kubectl-fdb/cmd/exec_test.go @@ -24,7 +24,7 @@ import ( "bytes" "context" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" . "github.com/onsi/ginkgo/v2" @@ -64,7 +64,7 @@ var _ = Describe("[plugin] exec command", func() { inBuffer := bytes.Buffer{} rootCmd := NewRootCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, &MockVersionChecker{}, ) Expect( diff --git a/kubectl-fdb/cmd/fix_coordinator_ips.go b/kubectl-fdb/cmd/fix_coordinator_ips.go index 0c934546c..8fc7fa484 100644 --- a/kubectl-fdb/cmd/fix_coordinator_ips.go +++ b/kubectl-fdb/cmd/fix_coordinator_ips.go @@ -32,12 +32,12 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newFixCoordinatorIPsCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newFixCoordinatorIPsCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/fix_coordinator_ips_test.go b/kubectl-fdb/cmd/fix_coordinator_ips_test.go index 72b3c312b..8a00f92fb 100644 --- a/kubectl-fdb/cmd/fix_coordinator_ips_test.go +++ b/kubectl-fdb/cmd/fix_coordinator_ips_test.go @@ -23,7 +23,7 @@ package cmd import ( "bytes" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" . "github.com/onsi/ginkgo/v2" @@ -84,7 +84,7 @@ var _ = Describe("[plugin] fix-coordinator-ips command", func() { inBuffer := bytes.Buffer{} rootCmd := NewRootCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, &MockVersionChecker{}, ) err := updateIPsInConnectionString(rootCmd, cluster, k8sClient) diff --git a/kubectl-fdb/cmd/get.go b/kubectl-fdb/cmd/get.go index 885fd04a0..b2f96311f 100644 --- a/kubectl-fdb/cmd/get.go +++ b/kubectl-fdb/cmd/get.go @@ -21,12 +21,12 @@ package cmd import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "github.com/spf13/cobra" ) -func newGetCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newGetCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/k8s_client_test.go b/kubectl-fdb/cmd/k8s_client_test.go index a9429d3c4..40b9e343d 100644 --- a/kubectl-fdb/cmd/k8s_client_test.go +++ b/kubectl-fdb/cmd/k8s_client_test.go @@ -27,7 +27,7 @@ import ( "strings" "time" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" corev1 "k8s.io/api/core/v1" @@ -352,7 +352,7 @@ var _ = Describe("[plugin] using the Kubernetes client", func() { DescribeTable("correctly follow various options", func(tc testCase) { tc.opts.namespace = namespace - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) result, err := getProcessGroupsByCluster(cmd, k8sClient, tc.opts) if tc.wantErrContains == "" { Expect(err).To(BeNil()) @@ -724,7 +724,7 @@ var _ = Describe("[plugin] using the Kubernetes client", func() { DescribeTable("correctly follow various options", func(tc testCase) { tc.opts.namespace = namespace - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) result, err := getPodNamesByCluster(cmd, k8sClient, tc.opts) if tc.wantErrContains == "" { Expect(err).To(BeNil()) diff --git a/kubectl-fdb/cmd/recover_multi_region_cluster.go b/kubectl-fdb/cmd/recover_multi_region_cluster.go index 51fd053bc..9c4a60c7e 100644 --- a/kubectl-fdb/cmd/recover_multi_region_cluster.go +++ b/kubectl-fdb/cmd/recover_multi_region_cluster.go @@ -37,7 +37,7 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" k8serrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -58,7 +58,7 @@ type RecoverMultiRegionClusterOpts struct { Stderr io.Writer } -func newRecoverMultiRegionClusterCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newRecoverMultiRegionClusterCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/remove.go b/kubectl-fdb/cmd/remove.go index 453a0f7fd..a21809cb6 100644 --- a/kubectl-fdb/cmd/remove.go +++ b/kubectl-fdb/cmd/remove.go @@ -21,12 +21,12 @@ package cmd import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "github.com/spf13/cobra" ) -func newRemoveCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newRemoveCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/remove_process_group.go b/kubectl-fdb/cmd/remove_process_group.go index 48ab409f2..bec629007 100644 --- a/kubectl-fdb/cmd/remove_process_group.go +++ b/kubectl-fdb/cmd/remove_process_group.go @@ -27,11 +27,11 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newRemoveProcessGroupCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newRemoveProcessGroupCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/remove_process_group_test.go b/kubectl-fdb/cmd/remove_process_group_test.go index 908e0b7ae..fc69dc2f9 100644 --- a/kubectl-fdb/cmd/remove_process_group_test.go +++ b/kubectl-fdb/cmd/remove_process_group_test.go @@ -27,7 +27,7 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -63,7 +63,7 @@ var _ = Describe("[plugin] remove process groups command", func() { DescribeTable("should cordon all targeted processes", func(tc testCase) { - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) _, err := replaceProcessGroups(cmd, k8sClient, processGroupSelectionOptions{ ids: tc.Instances, @@ -147,7 +147,7 @@ var _ = Describe("[plugin] remove process groups command", func() { "should add the process group to the removal without exclusion list", func() { removals := []string{"test-storage-1"} - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) _, err := replaceProcessGroups(cmd, k8sClient, processGroupSelectionOptions{ ids: removals, @@ -191,7 +191,7 @@ var _ = Describe("[plugin] remove process groups command", func() { "should add the process group to the removal without exclusion list", func() { removals := []string{"test-storage-1"} - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) _, err := replaceProcessGroups(cmd, k8sClient, processGroupSelectionOptions{ ids: removals, @@ -259,7 +259,7 @@ var _ = Describe("[plugin] remove process groups command", func() { DescribeTable("should remove specified processes via clusterLabel and podName(s)", func(tc testCase) { - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) _, err := replaceProcessGroups(cmd, k8sClient, processGroupSelectionOptions{ ids: tc.podNames, @@ -548,7 +548,7 @@ var _ = Describe("[plugin] remove process groups command", func() { } DescribeTable("should remove specified processes via clusterLabel and podName(s)", func(tc testCase) { - cmd := newRemoveProcessGroupCmd(genericclioptions.IOStreams{}) + cmd := newRemoveProcessGroupCmd(genericiooptions.IOStreams{}) _, err := replaceProcessGroups(cmd, k8sClient, processGroupSelectionOptions{ ids: tc.ids, diff --git a/kubectl-fdb/cmd/restart.go b/kubectl-fdb/cmd/restart.go index d4bd0d10e..beba678f7 100644 --- a/kubectl-fdb/cmd/restart.go +++ b/kubectl-fdb/cmd/restart.go @@ -27,12 +27,12 @@ import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" kubeHelper "github.com/FoundationDB/fdb-kubernetes-operator/v2/internal/kubernetes" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newRestartCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newRestartCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/restart_test.go b/kubectl-fdb/cmd/restart_test.go index afb342097..780e34b71 100644 --- a/kubectl-fdb/cmd/restart_test.go +++ b/kubectl-fdb/cmd/restart_test.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var _ = Describe("[plugin] root command", func() { @@ -43,7 +43,7 @@ var _ = Describe("[plugin] root command", func() { It("should not throw an error", func() { cmd := NewRootCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, &MockVersionChecker{}, ) diff --git a/kubectl-fdb/cmd/root.go b/kubectl-fdb/cmd/root.go index 0a33583a5..761a883e8 100644 --- a/kubectl-fdb/cmd/root.go +++ b/kubectl-fdb/cmd/root.go @@ -32,17 +32,18 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) // fdbBOptions provides information required to run different // actions on FDB type fdbBOptions struct { configFlags *genericclioptions.ConfigFlags - genericclioptions.IOStreams + genericiooptions.IOStreams } // newFDBOptions provides an instance of fdbBOptions with default values -func newFDBOptions(streams genericclioptions.IOStreams) *fdbBOptions { +func newFDBOptions(streams genericiooptions.IOStreams) *fdbBOptions { return &fdbBOptions{ configFlags: genericclioptions.NewConfigFlags(true), IOStreams: streams, @@ -51,7 +52,7 @@ func newFDBOptions(streams genericclioptions.IOStreams) *fdbBOptions { // NewRootCmd provides a cobra command wrapping FDB actions func NewRootCmd( - streams genericclioptions.IOStreams, + streams genericiooptions.IOStreams, pluginVersionChecker VersionChecker, ) *cobra.Command { o := newFDBOptions(streams) diff --git a/kubectl-fdb/cmd/root_test.go b/kubectl-fdb/cmd/root_test.go index 56b62de28..eb2539fc6 100644 --- a/kubectl-fdb/cmd/root_test.go +++ b/kubectl-fdb/cmd/root_test.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ) var _ = Describe("[plugin] root command", func() { @@ -43,7 +43,7 @@ var _ = Describe("[plugin] root command", func() { It("should not throw an error", func() { cmd := NewRootCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, &MockVersionChecker{}, ) cmd.SetArgs([]string{}) diff --git a/kubectl-fdb/cmd/update.go b/kubectl-fdb/cmd/update.go index c4f552357..1ea532a45 100644 --- a/kubectl-fdb/cmd/update.go +++ b/kubectl-fdb/cmd/update.go @@ -21,12 +21,12 @@ package cmd import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "github.com/spf13/cobra" ) -func newUpdateCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newUpdateCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/update_connection_string.go b/kubectl-fdb/cmd/update_connection_string.go index 3713516fb..fcc12c085 100644 --- a/kubectl-fdb/cmd/update_connection_string.go +++ b/kubectl-fdb/cmd/update_connection_string.go @@ -23,11 +23,11 @@ package cmd import ( fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/controller-runtime/pkg/client" ) -func newUpdateConnectionStringCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newUpdateConnectionStringCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{ diff --git a/kubectl-fdb/cmd/update_connection_string_test.go b/kubectl-fdb/cmd/update_connection_string_test.go index 3b986fe2d..8b53bbefd 100644 --- a/kubectl-fdb/cmd/update_connection_string_test.go +++ b/kubectl-fdb/cmd/update_connection_string_test.go @@ -31,7 +31,7 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" ctrlClient "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -50,7 +50,7 @@ var _ = Describe("[plugin] update connection string command", func() { errBuffer = bytes.Buffer{} inBuffer = bytes.Buffer{} cmd = NewRootCmd( - genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, + genericiooptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, &MockVersionChecker{}, ) initialConnectionString = cluster.Status.ConnectionString diff --git a/kubectl-fdb/cmd/version.go b/kubectl-fdb/cmd/version.go index 8f465aa4f..532d0b1b1 100644 --- a/kubectl-fdb/cmd/version.go +++ b/kubectl-fdb/cmd/version.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "github.com/spf13/cobra" ) @@ -35,7 +35,7 @@ var pluginVersion = "latest" var pluginBuildDate = "now" var pluginBuildCommit = "none" -func newVersionCmd(streams genericclioptions.IOStreams) *cobra.Command { +func newVersionCmd(streams genericiooptions.IOStreams) *cobra.Command { o := newFDBOptions(streams) cmd := &cobra.Command{