client

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	*genericclioptions.ConfigFlags
}

Flags represents the common configuration flags to create a client that interact with a Kubernetes cluster.

func DefaultFlags

func DefaultFlags() *Flags

DefaultFlags returns a new set client configuration flags with default values.

func (*Flags) AddFlags

func (f *Flags) AddFlags(flags *pflag.FlagSet)

AddFlags binds the client configuration flags to the given flag set.

func (*Flags) NewClient

func (f *Flags) NewClient() (Interface, error)

NewClient returns a new clients based on the flags' configuration.

func (*Flags) RegisterCompletionFunc

func (*Flags) RegisterCompletionFunc(cmd *cobra.Command, f cmdutil.Factory)

RegisterCompletionFunc registers the completion functions related to client configuration flags. Copied from the official `kubectl` command source: https://github.com/kubernetes/kubectl/blob/v0.23.1/pkg/cmd/cmd.go#L471-L492

type Interface

type Interface interface {
	GetRESTMapper() (meta.RESTMapper, error)
	IsClusterReachable() error
	HasGroupVersion(version schema.GroupVersion) (bool, error)
	ListVPAResources(context.Context, ListOptions) ([]*vpav1.VerticalPodAutoscaler, error)
	GetVPATarget(context.Context, *autoscalingv1.CrossVersionObjectReference, string) (*unstructuredv1.Unstructured, error)
	ListDependentPods(ctx context.Context, targetMeta metav1.ObjectMeta, labelSelector string) ([]*corev1.Pod, error)
}

Interface captures the methods of a client used to interact with a Kubernetes cluster.

type ListOptions

type ListOptions struct {
	Namespace      string
	AllNamespaces  bool
	ResourceNames  []string
	FieldSelector  string
	LabelSelector  string
	TimeoutSeconds *int64
	Limit          int64
}

ListOptions represents the options for listing resources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL