Skip to content

Commit 5bd976a

Browse files
authored
Remove the deprecated genericclioption (#2363)
* Remove the deprecated genericclioption
1 parent b4ead37 commit 5bd976a

32 files changed

+81
-80
lines changed

internal/kubernetes/kubernetes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
corev1 "k8s.io/api/core/v1"
3434
"k8s.io/apimachinery/pkg/runtime/schema"
3535
"k8s.io/apimachinery/pkg/runtime/serializer"
36-
"k8s.io/cli-runtime/pkg/genericclioptions"
36+
"k8s.io/cli-runtime/pkg/genericiooptions"
3737
"k8s.io/client-go/rest"
3838
"k8s.io/client-go/tools/remotecommand"
3939
"k8s.io/kubectl/pkg/cmd/exec"
@@ -89,7 +89,7 @@ func ExecuteCommandRaw(
8989
ContainerName: container,
9090
Stdin: stdin != nil,
9191
TTY: isTty,
92-
IOStreams: genericclioptions.IOStreams{
92+
IOStreams: genericiooptions.IOStreams{
9393
In: stdin,
9494
Out: stdout,
9595
ErrOut: stderr,

kubectl-fdb/cmd/analyze.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ import (
3636
"github.com/fatih/color"
3737
"github.com/spf13/cobra"
3838
corev1 "k8s.io/api/core/v1"
39-
"k8s.io/cli-runtime/pkg/genericclioptions"
39+
"k8s.io/cli-runtime/pkg/genericiooptions"
4040
"k8s.io/client-go/rest"
4141
"k8s.io/utils/ptr"
4242
"sigs.k8s.io/controller-runtime/pkg/client"
4343
)
4444

45-
func newAnalyzeCmd(streams genericclioptions.IOStreams) *cobra.Command {
45+
func newAnalyzeCmd(streams genericiooptions.IOStreams) *cobra.Command {
4646
o := newFDBOptions(streams)
4747

4848
cmd := &cobra.Command{

kubectl-fdb/cmd/buggify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
package cmd
2222

2323
import (
24-
"k8s.io/cli-runtime/pkg/genericclioptions"
24+
"k8s.io/cli-runtime/pkg/genericiooptions"
2525

2626
"github.com/spf13/cobra"
2727
)
2828

29-
func newBuggifyCmd(streams genericclioptions.IOStreams) *cobra.Command {
29+
func newBuggifyCmd(streams genericiooptions.IOStreams) *cobra.Command {
3030
o := newFDBOptions(streams)
3131

3232
cmd := &cobra.Command{

kubectl-fdb/cmd/buggify_crash_loop.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import (
2727
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
2828
"github.com/spf13/cobra"
2929
k8serrors "k8s.io/apimachinery/pkg/api/errors"
30-
"k8s.io/cli-runtime/pkg/genericclioptions"
30+
"k8s.io/cli-runtime/pkg/genericiooptions"
3131
"sigs.k8s.io/controller-runtime/pkg/client"
3232
)
3333

34-
func newBuggifyCrashLoop(streams genericclioptions.IOStreams) *cobra.Command {
34+
func newBuggifyCrashLoop(streams genericiooptions.IOStreams) *cobra.Command {
3535
o := newFDBOptions(streams)
3636

3737
cmd := &cobra.Command{

kubectl-fdb/cmd/buggify_crash_loop_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"context"
2525
"fmt"
2626

27-
"k8s.io/cli-runtime/pkg/genericclioptions"
27+
"k8s.io/cli-runtime/pkg/genericiooptions"
2828

2929
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3030
. "github.com/onsi/ginkgo/v2"
@@ -57,7 +57,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() {
5757
DescribeTable("should add all targeted process groups to crash-loop container list",
5858
func(tc processGroupOptionsTestCase) {
5959
Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(0))
60-
cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{})
60+
cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{})
6161
opts := buggifyProcessGroupOptions{
6262
containerName: fdbv1beta2.MainContainerName,
6363
wait: false,
@@ -229,7 +229,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() {
229229
DescribeTable("should add all targeted process groups to crash-loop container list",
230230
func(tc testCase) {
231231
Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1))
232-
cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{})
232+
cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{})
233233
opts := buggifyProcessGroupOptions{
234234
containerName: fdbv1beta2.MainContainerName,
235235
wait: false,
@@ -310,7 +310,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() {
310310
DescribeTable("should add all targeted processes to crash-loop container list",
311311
func(tc testCase) {
312312
Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1))
313-
cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{})
313+
cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{})
314314
opts := buggifyProcessGroupOptions{
315315
containerName: fdbv1beta2.MainContainerName,
316316
wait: false,
@@ -391,7 +391,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() {
391391
"should remove all targeted process groups from crash-loop container list",
392392
func(tc testCase) {
393393
Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1))
394-
cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{})
394+
cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{})
395395
opts := buggifyProcessGroupOptions{
396396
containerName: fdbv1beta2.MainContainerName,
397397
wait: false,
@@ -470,7 +470,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() {
470470

471471
It("should clear everything from the crash-loop container-list", func() {
472472
Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1))
473-
cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{})
473+
cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{})
474474
opts := buggifyProcessGroupOptions{
475475
containerName: fdbv1beta2.MainContainerName,
476476
wait: false,
@@ -500,7 +500,7 @@ var _ = Describe("[plugin] buggify crash-loop process groups command", func() {
500500
})
501501
It("should error if no cluster name is provided", func() {
502502
Expect(cluster.Spec.Buggify.CrashLoopContainers).To(HaveLen(1))
503-
cmd := newBuggifyCrashLoop(genericclioptions.IOStreams{})
503+
cmd := newBuggifyCrashLoop(genericiooptions.IOStreams{})
504504
opts := buggifyProcessGroupOptions{
505505
containerName: fdbv1beta2.MainContainerName,
506506
wait: false,

kubectl-fdb/cmd/buggify_empty_monitor_conf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ import (
2727

2828
"github.com/spf13/cobra"
2929
k8serrors "k8s.io/apimachinery/pkg/api/errors"
30-
"k8s.io/cli-runtime/pkg/genericclioptions"
30+
"k8s.io/cli-runtime/pkg/genericiooptions"
3131
"sigs.k8s.io/controller-runtime/pkg/client"
3232
)
3333

34-
func newBuggifyEmptyMonitorConf(streams genericclioptions.IOStreams) *cobra.Command {
34+
func newBuggifyEmptyMonitorConf(streams genericiooptions.IOStreams) *cobra.Command {
3535
o := newFDBOptions(streams)
3636

3737
cmd := &cobra.Command{

kubectl-fdb/cmd/buggify_no_schedule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import (
2626

2727
"github.com/spf13/cobra"
2828
k8serrors "k8s.io/apimachinery/pkg/api/errors"
29-
"k8s.io/cli-runtime/pkg/genericclioptions"
29+
"k8s.io/cli-runtime/pkg/genericiooptions"
3030
"sigs.k8s.io/controller-runtime/pkg/client"
3131
)
3232

33-
func newBuggifyNoSchedule(streams genericclioptions.IOStreams) *cobra.Command {
33+
func newBuggifyNoSchedule(streams genericiooptions.IOStreams) *cobra.Command {
3434
o := newFDBOptions(streams)
3535

3636
cmd := &cobra.Command{

kubectl-fdb/cmd/buggify_no_schedule_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
2828
. "github.com/onsi/ginkgo/v2"
2929
. "github.com/onsi/gomega"
30-
"k8s.io/cli-runtime/pkg/genericclioptions"
30+
"k8s.io/cli-runtime/pkg/genericiooptions"
3131
"sigs.k8s.io/controller-runtime/pkg/client"
3232
)
3333

@@ -49,7 +49,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() {
4949

5050
DescribeTable("should add all targeted processes to no-schedule list",
5151
func(tc processGroupOptionsTestCase) {
52-
cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{})
52+
cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{})
5353
tc.ProcessGroupOpts.namespace = namespace
5454
err := updateNoScheduleList(
5555
cmd,
@@ -201,7 +201,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() {
201201

202202
DescribeTable("should add all targeted processes to no-schedule list",
203203
func(tc testCase) {
204-
cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{})
204+
cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{})
205205
processGroupOpts := processGroupSelectionOptions{
206206
ids: tc.Instances,
207207
clusterName: clusterName,
@@ -272,7 +272,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() {
272272

273273
DescribeTable("should remove all targeted processes from the no-schedule list",
274274
func(tc testCase) {
275-
cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{})
275+
cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{})
276276
processGroupOpts := processGroupSelectionOptions{
277277
ids: tc.Instances,
278278
clusterName: clusterName,
@@ -328,7 +328,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() {
328328
})
329329

330330
It("should clear the no-schedule list", func() {
331-
cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{})
331+
cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{})
332332
processGroupOpts := processGroupSelectionOptions{
333333
clusterName: clusterName,
334334
namespace: namespace,
@@ -350,7 +350,7 @@ var _ = Describe("[plugin] buggify no-schedule instances command", func() {
350350
Expect(len(resCluster.Spec.Buggify.NoSchedule)).To(Equal(0))
351351
})
352352
It("should error if no cluster name is provided", func() {
353-
cmd := newBuggifyNoSchedule(genericclioptions.IOStreams{})
353+
cmd := newBuggifyNoSchedule(genericiooptions.IOStreams{})
354354
opts := buggifyProcessGroupOptions{
355355
containerName: fdbv1beta2.MainContainerName,
356356
wait: false,

kubectl-fdb/cmd/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import (
2525
"fmt"
2626

2727
"github.com/spf13/cobra"
28-
"k8s.io/cli-runtime/pkg/genericclioptions"
28+
"k8s.io/cli-runtime/pkg/genericiooptions"
2929
"sigs.k8s.io/controller-runtime/pkg/client"
3030
)
3131

32-
func newConfigurationCmd(streams genericclioptions.IOStreams) *cobra.Command {
32+
func newConfigurationCmd(streams genericiooptions.IOStreams) *cobra.Command {
3333
o := newFDBOptions(streams)
3434

3535
cmd := &cobra.Command{

kubectl-fdb/cmd/cordon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ import (
2525
"fmt"
2626

2727
fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
28-
"k8s.io/cli-runtime/pkg/genericclioptions"
28+
"k8s.io/cli-runtime/pkg/genericiooptions"
2929

3030
"github.com/spf13/cobra"
3131
"sigs.k8s.io/controller-runtime/pkg/client"
3232
)
3333

34-
func newCordonCmd(streams genericclioptions.IOStreams) *cobra.Command {
34+
func newCordonCmd(streams genericiooptions.IOStreams) *cobra.Command {
3535
o := newFDBOptions(streams)
3636
var nodeSelectors map[string]string
3737

0 commit comments

Comments
 (0)