Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kubernetes-sigs/cli-utils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.36.0
Choose a base ref
...
head repository: kubernetes-sigs/cli-utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.37.0
Choose a head ref
  • 9 commits
  • 34 files changed
  • 3 contributors

Commits on May 21, 2024

  1. Add status watch label & field selector filters

    Using a label filter significantly cuts down on watch events and
    memory used by the informer's watch cache. But you'll need to set
    the labels on the objects yourself before providing them to the
    applier.
    karlkfi committed May 21, 2024
    Copy the full SHA
    fe123cb View commit details
  2. Merge pull request #639 from karlkfi/karl-watch-filter

    Add status watch label filter
    k8s-ci-robot authored May 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9702fb8 View commit details

Commits on May 24, 2024

  1. Add WithStatusWatcherFilters to DestroyerBuilder

    karlkfi committed May 24, 2024
    Copy the full SHA
    7768584 View commit details

Commits on May 25, 2024

  1. Merge pull request #640 from karlkfi/karl-watch-filter-destroy

    Add WithStatusWatcherFilters to DestroyerBuilder
    k8s-ci-robot authored May 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    87074c9 View commit details

Commits on Jun 12, 2024

  1. Update dependencies

    ash2k committed Jun 12, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ash2k Mikhail Mazurskiy
    Copy the full SHA
    c2d5dec View commit details
  2. Fix compilation failure

    ash2k committed Jun 12, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ash2k Mikhail Mazurskiy
    Copy the full SHA
    3700109 View commit details
  3. Fix warnings

    ash2k committed Jun 12, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ash2k Mikhail Mazurskiy
    Copy the full SHA
    20ae0ed View commit details

Commits on Jun 18, 2024

  1. Stop using deprecated type

    This is not a breaking change since types are aliases
    ash2k committed Jun 18, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    ash2k Mikhail Mazurskiy
    Copy the full SHA
    ce2a947 View commit details

Commits on Jun 20, 2024

  1. Merge pull request #641 from ash2k/bump-deps

    Bump deps
    k8s-ci-robot authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    012918b View commit details
8 changes: 4 additions & 4 deletions cmd/apply/cmdapply.go
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions cmd/destroy/cmddestroy.go
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions cmd/diff/cmddiff.go
Original file line number Diff line number Diff line change
@@ -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)",
@@ -73,10 +73,7 @@ func Initialize(o *diff.DiffOptions, f util.Factory, args []string) (func(), err
}
o.FilenameOptions = filenameFlags.ToOptions()

o.OpenAPISchema, err = f.OpenAPISchema()
if err != nil {
return cleanupFunc, err
}
o.OpenAPIGetter = f

o.DynamicClient, err = f.DynamicClient()
if err != nil {
6 changes: 3 additions & 3 deletions cmd/initcmd/cmdinit.go
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 6 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -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,
8 changes: 4 additions & 4 deletions cmd/preview/cmdpreview.go
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions cmd/status/cmdstatus.go
Original file line number Diff line number Diff line change
@@ -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(),
6 changes: 3 additions & 3 deletions cmd/status/printers/event/printer.go
Original file line number Diff line number Diff line change
@@ -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,
6 changes: 3 additions & 3 deletions cmd/status/printers/json/printer.go
Original file line number Diff line number Diff line change
@@ -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,
4 changes: 2 additions & 2 deletions cmd/status/printers/printers.go
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions cmd/status/printers/table/printer.go
Original file line number Diff line number Diff line change
@@ -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,
Loading