diff --git a/cmd/apply/cmdapply.go b/cmd/apply/cmdapply.go index 73569f93..b502fdc3 100644 --- a/cmd/apply/cmdapply.go +++ b/cmd/apply/cmdapply.go @@ -10,7 +10,7 @@ import ( "time" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/util/i18n" "sigs.k8s.io/cli-utils/cmd/flagutils" @@ -22,7 +22,7 @@ import ( ) func GetRunner(factory cmdutil.Factory, invFactory inventory.ClientFactory, - loader manifestreader.ManifestLoader, ioStreams genericclioptions.IOStreams) *Runner { + loader manifestreader.ManifestLoader, ioStreams genericiooptions.IOStreams) *Runner { r := &Runner{ ioStreams: ioStreams, factory: factory, @@ -66,13 +66,13 @@ func GetRunner(factory cmdutil.Factory, invFactory inventory.ClientFactory, } func Command(f cmdutil.Factory, invFactory inventory.ClientFactory, loader manifestreader.ManifestLoader, - ioStreams genericclioptions.IOStreams) *cobra.Command { + ioStreams genericiooptions.IOStreams) *cobra.Command { return GetRunner(f, invFactory, loader, ioStreams).Command } type Runner struct { Command *cobra.Command - ioStreams genericclioptions.IOStreams + ioStreams genericiooptions.IOStreams factory cmdutil.Factory invFactory inventory.ClientFactory loader manifestreader.ManifestLoader diff --git a/cmd/destroy/cmddestroy.go b/cmd/destroy/cmddestroy.go index ecdcd40e..8923e50a 100644 --- a/cmd/destroy/cmddestroy.go +++ b/cmd/destroy/cmddestroy.go @@ -10,7 +10,7 @@ import ( "time" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/util/i18n" "sigs.k8s.io/cli-utils/cmd/flagutils" @@ -23,7 +23,7 @@ import ( // GetRunner creates and returns the Runner which stores the cobra command. func GetRunner(factory cmdutil.Factory, invFactory inventory.ClientFactory, - loader manifestreader.ManifestLoader, ioStreams genericclioptions.IOStreams) *Runner { + loader manifestreader.ManifestLoader, ioStreams genericiooptions.IOStreams) *Runner { r := &Runner{ ioStreams: ioStreams, factory: factory, @@ -57,14 +57,14 @@ func GetRunner(factory cmdutil.Factory, invFactory inventory.ClientFactory, // Command creates the Runner, returning the cobra command associated with it. func Command(f cmdutil.Factory, invFactory inventory.ClientFactory, loader manifestreader.ManifestLoader, - ioStreams genericclioptions.IOStreams) *cobra.Command { + ioStreams genericiooptions.IOStreams) *cobra.Command { return GetRunner(f, invFactory, loader, ioStreams).Command } // Runner encapsulates data necessary to run the destroy command. type Runner struct { Command *cobra.Command - ioStreams genericclioptions.IOStreams + ioStreams genericiooptions.IOStreams factory cmdutil.Factory invFactory inventory.ClientFactory loader manifestreader.ManifestLoader diff --git a/cmd/diff/cmddiff.go b/cmd/diff/cmddiff.go index 80fabaec..58d98fc9 100644 --- a/cmd/diff/cmddiff.go +++ b/cmd/diff/cmddiff.go @@ -7,7 +7,7 @@ import ( "os" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/klog/v2" "k8s.io/kubectl/pkg/cmd/diff" "k8s.io/kubectl/pkg/cmd/util" @@ -20,7 +20,7 @@ const tmpDirPrefix = "diff-cmd" // NewCommand returns cobra command to implement client-side diff of package // directory. For each local config file, get the resource in the cluster // and diff the local config resource against the resource in the cluster. -func NewCommand(f util.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { +func NewCommand(f util.Factory, ioStreams genericiooptions.IOStreams) *cobra.Command { options := diff.NewDiffOptions(ioStreams) cmd := &cobra.Command{ Use: "diff (DIRECTORY | STDIN)", diff --git a/cmd/initcmd/cmdinit.go b/cmd/initcmd/cmdinit.go index 095f94cb..b838e5d7 100644 --- a/cmd/initcmd/cmdinit.go +++ b/cmd/initcmd/cmdinit.go @@ -5,7 +5,7 @@ package initcmd import ( "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/util/i18n" "sigs.k8s.io/cli-utils/pkg/config" @@ -19,7 +19,7 @@ type InitRunner struct { // GetInitRunner builds and returns the InitRunner. Connects the InitOptions.Run // to the cobra command. -func GetInitRunner(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *InitRunner { +func GetInitRunner(f cmdutil.Factory, ioStreams genericiooptions.IOStreams) *InitRunner { io := config.NewInitOptions(f, ioStreams) cmd := &cobra.Command{ Use: "init DIRECTORY", @@ -42,6 +42,6 @@ func GetInitRunner(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *In } // NewCmdInit returns the cobra command for the init command. -func NewCmdInit(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { +func NewCmdInit(f cmdutil.Factory, ioStreams genericiooptions.IOStreams) *cobra.Command { return GetInitRunner(f, ioStreams).Command } diff --git a/cmd/main.go b/cmd/main.go index dbb985aa..9b7aedec 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -13,6 +13,11 @@ import ( "github.com/spf13/cobra" "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" + + // This is here rather than in the libraries because of + // https://github.com/kubernetes-sigs/kustomize/issues/2060 + _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/rest" "k8s.io/component-base/cli" "k8s.io/klog/v2" @@ -26,10 +31,6 @@ import ( "sigs.k8s.io/cli-utils/pkg/flowcontrol" "sigs.k8s.io/cli-utils/pkg/inventory" "sigs.k8s.io/cli-utils/pkg/manifestreader" - - // This is here rather than in the libraries because of - // https://github.com/kubernetes-sigs/kustomize/issues/2060 - _ "k8s.io/client-go/plugin/pkg/client/auth" ) func main() { @@ -55,7 +56,7 @@ func main() { // Update ConfigFlags before subcommands run that talk to the server. preRunE := newConfigFilerPreRunE(f, kubeConfigFlags) - ioStreams := genericclioptions.IOStreams{ + ioStreams := genericiooptions.IOStreams{ In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr, diff --git a/cmd/preview/cmdpreview.go b/cmd/preview/cmdpreview.go index c3c2cc3d..c658c7fb 100644 --- a/cmd/preview/cmdpreview.go +++ b/cmd/preview/cmdpreview.go @@ -10,7 +10,7 @@ import ( "time" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/util/i18n" "sigs.k8s.io/cli-utils/cmd/flagutils" @@ -29,7 +29,7 @@ var ( // GetRunner creates and returns the Runner which stores the cobra command. func GetRunner(factory cmdutil.Factory, invFactory inventory.ClientFactory, - loader manifestreader.ManifestLoader, ioStreams genericclioptions.IOStreams) *Runner { + loader manifestreader.ManifestLoader, ioStreams genericiooptions.IOStreams) *Runner { r := &Runner{ factory: factory, invFactory: invFactory, @@ -66,7 +66,7 @@ func GetRunner(factory cmdutil.Factory, invFactory inventory.ClientFactory, // Command creates the Runner, returning the cobra command associated with it. func Command(f cmdutil.Factory, invFactory inventory.ClientFactory, loader manifestreader.ManifestLoader, - ioStreams genericclioptions.IOStreams) *cobra.Command { + ioStreams genericiooptions.IOStreams) *cobra.Command { return GetRunner(f, invFactory, loader, ioStreams).Command } @@ -76,7 +76,7 @@ type Runner struct { factory cmdutil.Factory invFactory inventory.ClientFactory loader manifestreader.ManifestLoader - ioStreams genericclioptions.IOStreams + ioStreams genericiooptions.IOStreams serverSideOptions common.ServerSideOptions output string diff --git a/cmd/status/cmdstatus.go b/cmd/status/cmdstatus.go index 9207359d..46ee87ee 100644 --- a/cmd/status/cmdstatus.go +++ b/cmd/status/cmdstatus.go @@ -10,7 +10,7 @@ import ( "time" "github.com/spf13/cobra" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/util/slice" "sigs.k8s.io/cli-utils/cmd/flagutils" @@ -260,7 +260,7 @@ func (r *Runner) runE(cmd *cobra.Command, args []string) error { // Fetch a printer implementation based on the desired output format as // specified in the output flag. - printer, err := printers.CreatePrinter(r.output, genericclioptions.IOStreams{ + printer, err := printers.CreatePrinter(r.output, genericiooptions.IOStreams{ In: cmd.InOrStdin(), Out: cmd.OutOrStdout(), ErrOut: cmd.ErrOrStderr(), diff --git a/cmd/status/printers/event/printer.go b/cmd/status/printers/event/printer.go index 6cc57dd1..845bd780 100644 --- a/cmd/status/printers/event/printer.go +++ b/cmd/status/printers/event/printer.go @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/cmd/status/printers/printer" "sigs.k8s.io/cli-utils/pkg/apply/event" "sigs.k8s.io/cli-utils/pkg/common" @@ -22,12 +22,12 @@ import ( // status information as a list of events as they happen. type Printer struct { Formatter list.Formatter - IOStreams genericclioptions.IOStreams + IOStreams genericiooptions.IOStreams Data *printer.PrintData } // NewPrinter returns a new instance of the eventPrinter. -func NewPrinter(ioStreams genericclioptions.IOStreams, printData *printer.PrintData) *Printer { +func NewPrinter(ioStreams genericiooptions.IOStreams, printData *printer.PrintData) *Printer { return &Printer{ Formatter: events.NewFormatter(ioStreams, common.DryRunNone), IOStreams: ioStreams, diff --git a/cmd/status/printers/json/printer.go b/cmd/status/printers/json/printer.go index f644c029..e65e074e 100644 --- a/cmd/status/printers/json/printer.go +++ b/cmd/status/printers/json/printer.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/cmd/status/printers/printer" "sigs.k8s.io/cli-utils/pkg/apply/event" "sigs.k8s.io/cli-utils/pkg/common" @@ -24,12 +24,12 @@ import ( // status information as a list of events as they happen. type Printer struct { Formatter list.Formatter - IOStreams genericclioptions.IOStreams + IOStreams genericiooptions.IOStreams Data *printer.PrintData } // NewPrinter returns a new instance of the eventPrinter. -func NewPrinter(ioStreams genericclioptions.IOStreams, printData *printer.PrintData) *Printer { +func NewPrinter(ioStreams genericiooptions.IOStreams, printData *printer.PrintData) *Printer { return &Printer{ Formatter: jsonprinter.NewFormatter(ioStreams, common.DryRunNone), IOStreams: ioStreams, diff --git a/cmd/status/printers/printers.go b/cmd/status/printers/printers.go index 2edf745c..e62ec1b6 100644 --- a/cmd/status/printers/printers.go +++ b/cmd/status/printers/printers.go @@ -4,7 +4,7 @@ package printers import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/cmd/status/printers/event" "sigs.k8s.io/cli-utils/cmd/status/printers/json" "sigs.k8s.io/cli-utils/cmd/status/printers/printer" @@ -13,7 +13,7 @@ import ( // CreatePrinter return an implementation of the Printer interface. The // actual implementation is based on the printerType requested. -func CreatePrinter(printerType string, ioStreams genericclioptions.IOStreams, printData *printer.PrintData) (printer.Printer, error) { +func CreatePrinter(printerType string, ioStreams genericiooptions.IOStreams, printData *printer.PrintData) (printer.Printer, error) { switch printerType { case "table": return table.NewPrinter(ioStreams, printData), nil diff --git a/cmd/status/printers/table/printer.go b/cmd/status/printers/table/printer.go index 511e9d87..f0acf565 100644 --- a/cmd/status/printers/table/printer.go +++ b/cmd/status/printers/table/printer.go @@ -8,7 +8,7 @@ import ( "io" "time" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/cmd/status/printers/printer" "sigs.k8s.io/cli-utils/pkg/kstatus/polling/collector" "sigs.k8s.io/cli-utils/pkg/kstatus/polling/event" @@ -24,12 +24,12 @@ const ( // Printer is an implementation of the Printer interface that outputs // status information about resources in a table format with in-place updates. type Printer struct { - IOStreams genericclioptions.IOStreams + IOStreams genericiooptions.IOStreams PrintData *printer.PrintData } // NewPrinter returns a new instance of the tablePrinter. -func NewPrinter(ioStreams genericclioptions.IOStreams, printData *printer.PrintData) *Printer { +func NewPrinter(ioStreams genericiooptions.IOStreams, printData *printer.PrintData) *Printer { return &Printer{ IOStreams: ioStreams, PrintData: printData, diff --git a/pkg/apply/mutator/apply_time_mutator_test.go b/pkg/apply/mutator/apply_time_mutator_test.go index 9e06ec55..5c5c0fdc 100644 --- a/pkg/apply/mutator/apply_time_mutator_test.go +++ b/pkg/apply/mutator/apply_time_mutator_test.go @@ -7,6 +7,11 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + // Using gopkg.in/yaml.v3 instead of sigs.k8s.io/yaml on purpose. + // yaml.v3 correctly parses ints: + // https://github.com/kubernetes-sigs/yaml/issues/45 + "gopkg.in/yaml.v3" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta/testrestmapper" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -18,13 +23,6 @@ import ( "sigs.k8s.io/cli-utils/pkg/apply/cache" ktestutil "sigs.k8s.io/cli-utils/pkg/kstatus/polling/testutil" "sigs.k8s.io/cli-utils/pkg/object" - - // Using gopkg.in/yaml.v3 instead of sigs.k8s.io/yaml on purpose. - // yaml.v3 correctly parses ints: - // https://github.com/kubernetes-sigs/yaml/issues/45 - "gopkg.in/yaml.v3" - - "github.com/stretchr/testify/require" ) var expectedReason = "object contained annotation: config.kubernetes.io/apply-time-mutation" diff --git a/pkg/apply/task/apply_task.go b/pkg/apply/task/apply_task.go index e379153a..48280b22 100644 --- a/pkg/apply/task/apply_task.go +++ b/pkg/apply/task/apply_task.go @@ -15,13 +15,13 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/cli-runtime/pkg/resource" "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" "k8s.io/klog/v2" "k8s.io/kubectl/pkg/cmd/apply" cmddelete "k8s.io/kubectl/pkg/cmd/delete" - applyerror "sigs.k8s.io/cli-utils/pkg/apply/error" "sigs.k8s.io/cli-utils/pkg/apply/event" "sigs.k8s.io/cli-utils/pkg/apply/filter" @@ -193,7 +193,7 @@ func newApplyOptions(taskName string, eventChannel chan<- event.Event, serverSid Overwrite: true, // Normally set in apply.NewApplyOptions OpenAPIPatch: true, // Normally set in apply.NewApplyOptions Recorder: genericclioptions.NoopRecorder{}, - IOStreams: genericclioptions.IOStreams{ + IOStreams: genericiooptions.IOStreams{ Out: io.Discard, ErrOut: io.Discard, // TODO: Warning for no lastConfigurationAnnotation // is printed directly to stderr in ApplyOptions. We diff --git a/pkg/config/initoptions.go b/pkg/config/initoptions.go index 135268dd..8e3ee5fb 100644 --- a/pkg/config/initoptions.go +++ b/pkg/config/initoptions.go @@ -12,7 +12,7 @@ import ( "time" "github.com/google/uuid" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "k8s.io/klog/v2" cmdutil "k8s.io/kubectl/pkg/cmd/util" "sigs.k8s.io/cli-utils/pkg/common" @@ -31,7 +31,7 @@ const ( type InitOptions struct { factory cmdutil.Factory - ioStreams genericclioptions.IOStreams + ioStreams genericiooptions.IOStreams // Template string; must be a valid k8s resource. Template string // Package directory argument; must be valid directory. @@ -42,7 +42,7 @@ type InitOptions struct { InventoryID string } -func NewInitOptions(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *InitOptions { +func NewInitOptions(f cmdutil.Factory, ioStreams genericiooptions.IOStreams) *InitOptions { return &InitOptions{ factory: f, ioStreams: ioStreams, diff --git a/pkg/flowcontrol/flowcontrol_test.go b/pkg/flowcontrol/flowcontrol_test.go index 2cf7217f..52c38e97 100644 --- a/pkg/flowcontrol/flowcontrol_test.go +++ b/pkg/flowcontrol/flowcontrol_test.go @@ -5,14 +5,13 @@ package flowcontrol import ( "bytes" + "context" "io" "net/http" "net/http/httptest" "testing" "time" - "context" - "github.com/stretchr/testify/assert" flowcontrolapi "k8s.io/api/flowcontrol/v1beta2" "k8s.io/client-go/rest" diff --git a/pkg/jsonpath/jsonpath.go b/pkg/jsonpath/jsonpath.go index 728a5f09..8dc77cd2 100644 --- a/pkg/jsonpath/jsonpath.go +++ b/pkg/jsonpath/jsonpath.go @@ -7,14 +7,13 @@ import ( "encoding/json" "fmt" + "github.com/spyzhov/ajson" // Using gopkg.in/yaml.v3 instead of sigs.k8s.io/yaml on purpose. // yaml.v3 correctly parses ints: // https://github.com/kubernetes-sigs/yaml/issues/45 // yaml.v3 Node is also used as input to yqlib. "gopkg.in/yaml.v3" "k8s.io/klog/v2" - - "github.com/spyzhov/ajson" ) // Get evaluates the JSONPath expression to extract values from the input map. diff --git a/pkg/print/table/base.go b/pkg/print/table/base.go index bfbc6521..6ce917d5 100644 --- a/pkg/print/table/base.go +++ b/pkg/print/table/base.go @@ -9,7 +9,7 @@ import ( "strings" "unicode/utf8" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" pe "sigs.k8s.io/cli-utils/pkg/kstatus/polling/event" "sigs.k8s.io/cli-utils/pkg/object" "sigs.k8s.io/cli-utils/pkg/print/common" @@ -44,7 +44,7 @@ type Resource interface { // The printer will print to the Out stream defined in IOStreams, // and will print into the format defined by the Column definitions. type BaseTablePrinter struct { - IOStreams genericclioptions.IOStreams + IOStreams genericiooptions.IOStreams Columns []ColumnDefinition } diff --git a/pkg/printers/events/formatter.go b/pkg/printers/events/formatter.go index d5fd87cd..3f9e1f5f 100644 --- a/pkg/printers/events/formatter.go +++ b/pkg/printers/events/formatter.go @@ -8,7 +8,7 @@ import ( "strings" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/pkg/apply/event" "sigs.k8s.io/cli-utils/pkg/common" "sigs.k8s.io/cli-utils/pkg/object" @@ -17,7 +17,7 @@ import ( "sigs.k8s.io/cli-utils/pkg/print/stats" ) -func NewFormatter(ioStreams genericclioptions.IOStreams, +func NewFormatter(ioStreams genericiooptions.IOStreams, _ common.DryRunStrategy) list.Formatter { return &formatter{ ioStreams: ioStreams, @@ -25,7 +25,7 @@ func NewFormatter(ioStreams genericclioptions.IOStreams, } type formatter struct { - ioStreams genericclioptions.IOStreams + ioStreams genericiooptions.IOStreams } func (ef *formatter) FormatValidationEvent(ve event.ValidationEvent) error { diff --git a/pkg/printers/events/printer.go b/pkg/printers/events/printer.go index c04cf4cd..d34cd9c6 100644 --- a/pkg/printers/events/printer.go +++ b/pkg/printers/events/printer.go @@ -4,13 +4,13 @@ package events import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/pkg/common" "sigs.k8s.io/cli-utils/pkg/print/list" "sigs.k8s.io/cli-utils/pkg/printers/printer" ) -func NewPrinter(ioStreams genericclioptions.IOStreams) printer.Printer { +func NewPrinter(ioStreams genericiooptions.IOStreams) printer.Printer { return &list.BaseListPrinter{ FormatterFactory: func(previewStrategy common.DryRunStrategy) list.Formatter { return NewFormatter(ioStreams, previewStrategy) diff --git a/pkg/printers/json/formatter.go b/pkg/printers/json/formatter.go index 24942f45..983b28a6 100644 --- a/pkg/printers/json/formatter.go +++ b/pkg/printers/json/formatter.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/pkg/apply/event" "sigs.k8s.io/cli-utils/pkg/common" "sigs.k8s.io/cli-utils/pkg/object" @@ -17,7 +17,7 @@ import ( "sigs.k8s.io/cli-utils/pkg/print/stats" ) -func NewFormatter(ioStreams genericclioptions.IOStreams, +func NewFormatter(ioStreams genericiooptions.IOStreams, _ common.DryRunStrategy) list.Formatter { return &formatter{ ioStreams: ioStreams, @@ -26,7 +26,7 @@ func NewFormatter(ioStreams genericclioptions.IOStreams, } type formatter struct { - ioStreams genericclioptions.IOStreams + ioStreams genericiooptions.IOStreams now func() time.Time } diff --git a/pkg/printers/json/printer.go b/pkg/printers/json/printer.go index 4f2611f1..ace25bde 100644 --- a/pkg/printers/json/printer.go +++ b/pkg/printers/json/printer.go @@ -4,13 +4,13 @@ package json import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/pkg/common" "sigs.k8s.io/cli-utils/pkg/print/list" "sigs.k8s.io/cli-utils/pkg/printers/printer" ) -func NewPrinter(ioStreams genericclioptions.IOStreams) printer.Printer { +func NewPrinter(ioStreams genericiooptions.IOStreams) printer.Printer { return &list.BaseListPrinter{ FormatterFactory: func(previewStrategy common.DryRunStrategy) list.Formatter { return NewFormatter(ioStreams, previewStrategy) diff --git a/pkg/printers/printers.go b/pkg/printers/printers.go index 9e07445c..6145b882 100644 --- a/pkg/printers/printers.go +++ b/pkg/printers/printers.go @@ -4,7 +4,7 @@ package printers import ( - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/pkg/common" "sigs.k8s.io/cli-utils/pkg/print/list" "sigs.k8s.io/cli-utils/pkg/printers/events" @@ -19,7 +19,7 @@ const ( JSONPrinter = "json" ) -func GetPrinter(printerType string, ioStreams genericclioptions.IOStreams) printer.Printer { +func GetPrinter(printerType string, ioStreams genericiooptions.IOStreams) printer.Printer { switch printerType { //nolint:gocritic case TablePrinter: return &table.Printer{ diff --git a/pkg/printers/table/printer.go b/pkg/printers/table/printer.go index 82f7cf22..de09f737 100644 --- a/pkg/printers/table/printer.go +++ b/pkg/printers/table/printer.go @@ -8,7 +8,7 @@ import ( "io" "time" - "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/cli-runtime/pkg/genericiooptions" "sigs.k8s.io/cli-utils/pkg/apply/event" "sigs.k8s.io/cli-utils/pkg/common" printcommon "sigs.k8s.io/cli-utils/pkg/print/common" @@ -16,7 +16,7 @@ import ( ) type Printer struct { - IOStreams genericclioptions.IOStreams + IOStreams genericiooptions.IOStreams } func (t *Printer) Print(ch <-chan event.Event, _ common.DryRunStrategy, _ bool) error {