common

package
v1.6.0-release Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(clientConfig clientcmd.ClientConfig) (client.Client, error)

NewClient returns a new controller-runtime client instance

func NewClientset

func NewClientset(clientConfig clientcmd.ClientConfig) (*kubernetes.Clientset, error)

NewClientset returns a new client-go instance

Types

type Options

type Options struct {
	ConfigFlags   *genericclioptions.ConfigFlags
	Client        client.Client
	Clientset     *kubernetes.Clientset
	UserNamespace string
}

Options encapsulates the common fields of command options

func (*Options) GetClientConfig

func (o *Options) GetClientConfig() clientcmd.ClientConfig

GetClientConfig returns the client config

func (*Options) Init

func (o *Options) Init(cmd *cobra.Command) error

Init initialize the common config of command options

func (*Options) SetClient

func (o *Options) SetClient(client client.Client)

SetClient configures the client

func (*Options) SetClientset

func (o *Options) SetClientset(clientset *kubernetes.Clientset)

SetClientset configures the clientset

func (*Options) SetConfigFlags

func (o *Options) SetConfigFlags()

SetConfigFlags configures the config flags

func (*Options) SetNamespace

func (o *Options) SetNamespace(ns string)

SetNamespace configures the namespace

Jump to

Keyboard shortcuts

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