factory

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidArgsListCertificateRequests

func ValidArgsListCertificateRequests(ctx context.Context, factory **Factory) func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

ValidArgsListCertificateRequests returns a cobra ValidArgsFunction for listing CertificateRequests.

func ValidArgsListCertificateSigningRequests

func ValidArgsListCertificateSigningRequests(ctx context.Context, factory **Factory) func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

ValidArgsListCertificateSigningRequests returns a cobra ValidArgsFunction for listing CertificateSigningRequests.

func ValidArgsListCertificates

func ValidArgsListCertificates(ctx context.Context, factory **Factory) func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

ValidArgsListCertificates returns a cobra ValidArgsFunction for listing Certificates.

func ValidArgsListSecrets

func ValidArgsListSecrets(ctx context.Context, factory **Factory) func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

ValidArgsListSecrets returns a cobra ValidArgsFunction for listing Secrets.

Types

type Factory

type Factory struct {
	// Namespace is the namespace that the user has requested with the
	// "--namespace" / "-n" flag. Defaults to "default" if the flag was not
	// provided.
	Namespace string

	// EnforceNamespace will be true if the user provided the namespace flag.
	EnforceNamespace bool

	// RESTConfig is a Kubernetes REST config that contains the user's
	// authentication and access configuration.
	RESTConfig *rest.Config

	// CMClient is a Kubernetes clientset for interacting with cert-manager APIs.
	CMClient cmclient.Interface

	// KubeClient is a Kubernetes clientset for interacting with the base
	// Kubernetes APIs.
	KubeClient kubernetes.Interface

	// RESTClientGetter is used to get RESTConfig, DiscoveryClients and
	// RESTMapper implementations
	RESTClientGetter genericclioptions.RESTClientGetter
}

Factory provides a set of clients and configurations to authenticate and access a target Kubernetes cluster. Factory will ensure that its fields are populated and valid during command execution.

func New

func New(ctx context.Context, cmd *cobra.Command) *Factory

New returns a new Factory. The supplied command will have flags registered for interacting with the Kubernetes access options. Factory will be populated when the command is executed using the cobra PreRun. If a PreRun is already defined, it will be executed _after_ Factory has been populated, making it available.

Jump to

Keyboard shortcuts

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