Documentation ¶
Index ¶
- type ClientOptions
- func (o *ClientOptions) AddFlags(flags *pflag.FlagSet)
- func (o *ClientOptions) ControllerRuntimeClient() (client.Client, error)
- func (o *ClientOptions) ControllerRuntimeClientWithOptions(opts client.Options) (client.Client, error)
- func (o *ClientOptions) FieldOwner() string
- func (o *ClientOptions) KubernetesClient() (kubernetes.Interface, error)
- func (o *ClientOptions) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (o *ClientOptions) ToRESTConfig() (*rest.Config, error)
- func (o *ClientOptions) ToRESTMapper() (meta.RESTMapper, error)
- func (o *ClientOptions) ToRawKubeConfigLoader() clientcmd.ClientConfig
- func (o *ClientOptions) WithDiscoveryBurst(discoveryBurst int) *ClientOptions
- func (o *ClientOptions) WithFieldOwner(fieldOwner string) *ClientOptions
- func (o *ClientOptions) WithImpersonation() *ClientOptions
- func (o *ClientOptions) WithKubeAPIBurst(burst int) *ClientOptions
- func (o *ClientOptions) WithKubeAPIQPS(qps float32) *ClientOptions
- type DeleteOptions
- type FeatureGateOptions
- type GetOptions
- type PrintOptions
- func (o *PrintOptions) AddFlags(cmd *cobra.Command)
- func (o *PrintOptions) AllowedFormats() []string
- func (o *PrintOptions) OutputFormat() string
- func (o *PrintOptions) ToPrinter(allNamespaces, multipleGVKs bool, gk schema.GroupKind) (printers.ResourcePrinter, error)
- func (o *PrintOptions) WithOutputFormat(outputFormat string) *PrintOptions
- type RESTClientGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
ClientOptions holds options for Kubernetes clients.
func NewClientOptions ¶
func NewClientOptions(usePersistentConfig bool) *ClientOptions
NewClientOptions creates ClientOptions with default settings.
func (*ClientOptions) AddFlags ¶
func (o *ClientOptions) AddFlags(flags *pflag.FlagSet)
AddFlags adds flags for configuring the Kubernetes clients to the provided FlagSet.
func (*ClientOptions) ControllerRuntimeClient ¶
func (o *ClientOptions) ControllerRuntimeClient() (client.Client, error)
ControllerRuntimeClient returns a (dynamic) controller runtime Kubernets client with default settings.
func (*ClientOptions) ControllerRuntimeClientWithOptions ¶
func (o *ClientOptions) ControllerRuntimeClientWithOptions(opts client.Options) (client.Client, error)
ControllerRuntimeClient returns a (dynamic) controller runtime Kubernets client with the provided settings.
func (*ClientOptions) FieldOwner ¶
func (o *ClientOptions) FieldOwner() string
FieldOwner returns the field owner.
func (*ClientOptions) KubernetesClient ¶
func (o *ClientOptions) KubernetesClient() (kubernetes.Interface, error)
KubernetesClient returns a (typed) configured Kubernetes client.
func (*ClientOptions) ToDiscoveryClient ¶
func (o *ClientOptions) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
ToDiscoveryClient implements RESTClientGetter. Expects the AddFlags method to have been called. Returns a CachedDiscoveryInterface using a computed RESTConfig.
func (*ClientOptions) ToRESTConfig ¶
func (o *ClientOptions) ToRESTConfig() (*rest.Config, error)
ToRESTConfig implements RESTClientGetter. Returns a REST client configuration based on a provided path to a .kubeconfig file, loading rules, and config flag overrides. Expects the AddFlags method to have been called. If WrapConfigFn is non-nil this function can transform config before return.
func (*ClientOptions) ToRESTMapper ¶
func (o *ClientOptions) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper returns a mapper.
func (*ClientOptions) ToRawKubeConfigLoader ¶
func (o *ClientOptions) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader binds config flag values to config overrides Returns an interactive clientConfig if the password flag is enabled, or a non-interactive clientConfig otherwise.
func (*ClientOptions) WithDiscoveryBurst ¶
func (o *ClientOptions) WithDiscoveryBurst(discoveryBurst int) *ClientOptions
WithDiscoveryBurst sets the RESTClient burst for discovery.
func (*ClientOptions) WithFieldOwner ¶
func (o *ClientOptions) WithFieldOwner(fieldOwner string) *ClientOptions
WithFieldOwner sets the field owner.
func (*ClientOptions) WithImpersonation ¶
func (o *ClientOptions) WithImpersonation() *ClientOptions
WithImpersonation enables support for impersonation.
func (*ClientOptions) WithKubeAPIBurst ¶
func (o *ClientOptions) WithKubeAPIBurst(burst int) *ClientOptions
WithKubeAPIBurst sets the maximum burst for the rate limit.
func (*ClientOptions) WithKubeAPIQPS ¶
func (o *ClientOptions) WithKubeAPIQPS(qps float32) *ClientOptions
WithKubeAPIQPS sets the the maximum QPS to the master from this client.
type DeleteOptions ¶
type DeleteOptions struct {
// contains filtered or unexported fields
}
DeleteOptions contains settings for deleting Kubernetes resources.
func NewDeleteOptions ¶
func NewDeleteOptions() *DeleteOptions
NewDeleteOptions creates DeleteOptions with default settings.
func (*DeleteOptions) AddFlags ¶
func (o *DeleteOptions) AddFlags(flags *pflag.FlagSet)
AddFlags adds flags for configuring resource deletion to the provided FlagSet.
func (*DeleteOptions) ToResourceBuilder ¶
func (o *DeleteOptions) ToResourceBuilder( restClientGetter RESTClientGetter, getArgs ...string, ) genericclioptions.ResourceFinder
ToResourceBuilder creates a resource builder that can be used to retrieve generic resources from the API server. The `getArgs` slice must be of the form `(<type1>[,<type2>,...]|<type> <name1>[,<name2>,...])`. When one argument is received, the types provided will be retrieved from the server (and be comma delimited). When two or more arguments are received, they must be a single type and resource name(s).
type FeatureGateOptions ¶
type FeatureGateOptions struct {
// contains filtered or unexported fields
}
FeatureGateOptions manages a CLIs feature gates.
func NewFeatureGateOptions ¶
func NewFeatureGateOptions(features map[featuregate.Feature]featuregate.FeatureSpec) (*FeatureGateOptions, error)
NewFeatureGateOptions initializes a FeatureGateOptions object with the provided features.
func (*FeatureGateOptions) AddFlag ¶
func (o *FeatureGateOptions) AddFlag(fs *pflag.FlagSet)
AddFlag adds flags for enabling feature gates to the provided FlagSet.
func (*FeatureGateOptions) Enabled ¶
func (o *FeatureGateOptions) Enabled(key string) bool
Enabled answers wheather a feature is enabled.
func (*FeatureGateOptions) KnownFeatures ¶
func (o *FeatureGateOptions) KnownFeatures() []string
KnownFeatures returns a list of text descriptions of all known features.
type GetOptions ¶
type GetOptions struct {
// contains filtered or unexported fields
}
GetOptions contains options for retrieving Kubernetes resources.
func NewGetOptions ¶
func NewGetOptions() *GetOptions
NewGetOptions creates GetOptions with default settings.
func (*GetOptions) AddFlags ¶
func (o *GetOptions) AddFlags(flags *pflag.FlagSet)
AddFlags adds flags for configuring get options to the provided FlagSet.
func (*GetOptions) AllNamespaces ¶
func (o *GetOptions) AllNamespaces() bool
AllNamespaces returns true if getting resources from all namespaces is enabled.
func (*GetOptions) ToResourceBuilder ¶
func (o *GetOptions) ToResourceBuilder(restClientGetter RESTClientGetter, resources ...string) *resource.Builder
ToResourceBuilder creates a resource builder that can be used to retrieve generic resources from the API server. The `getArgs` slice must be of the form `(<type1>[,<type2>,...]|<type> <name1>[,<name2>,...])`. When one argument is received, the types provided will be retrieved from the server (and be comma delimited). When two or more arguments are received, they must be a single type and resource name(s). ToBuilder gives you back a resource finder to visit resources that are located.
type PrintOptions ¶
type PrintOptions struct {
// contains filtered or unexported fields
}
PrintOptions holds settings for output formatting.
func NewPrintOptions ¶
func NewPrintOptions() *PrintOptions
NewPrintOptions creates PrintOptions with default settings.
func (*PrintOptions) AddFlags ¶
func (o *PrintOptions) AddFlags(cmd *cobra.Command)
AddFlags adds flags for setting print options to a command.
func (*PrintOptions) AllowedFormats ¶
func (o *PrintOptions) AllowedFormats() []string
AllowedFormats returns a list of supported output formats.
func (*PrintOptions) OutputFormat ¶
func (o *PrintOptions) OutputFormat() string
OutputFormat returns the currently set output format.
func (*PrintOptions) ToPrinter ¶
func (o *PrintOptions) ToPrinter( allNamespaces, multipleGVKs bool, gk schema.GroupKind, ) (printers.ResourcePrinter, error)
ToPrinter creates a ResourcePrinter with the configured format.
func (*PrintOptions) WithOutputFormat ¶
func (o *PrintOptions) WithOutputFormat(outputFormat string) *PrintOptions
WithOutputFormat sets the output format.
type RESTClientGetter ¶
type RESTClientGetter interface { // ToRESTConfig returns restconfig ToRESTConfig() (*rest.Config, error) // ToDiscoveryClient returns discovery client ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error) // ToRESTMapper returns a restmapper ToRESTMapper() (meta.RESTMapper, error) // ToRawKubeConfigLoader return kubeconfig loader as-is ToRawKubeConfigLoader() clientcmd.ClientConfig }
RESTClientGetter is an interface that the ClientOptions describe to provide an easier way to mock for commands and eliminate the direct coupling to a struct type. Users may wish to duplicate this type in their own packages as per the golang type overlapping.