Documentation
¶
Overview ¶
Package cmd holds what every kubectl-nv command needs before it can talk to a cluster: the kubectl configuration flags, the resolved kubeconfig path, and the factory the commands get their clients from.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConfigFlags ¶
func AddConfigFlags(flags *pflag.FlagSet, configFlags *genericclioptions.ConfigFlags)
AddConfigFlags registers the kubectl configuration flags on flags, giving --kubeconfig the -k shorthand that kubectl-nv accepted before it moved to cobra.
Types ¶
type Factory ¶
type Factory interface {
KubernetesClient() (kubernetes.Interface, error)
DynamicClient() (dynamic.Interface, error)
RESTConfig() (*rest.Config, error)
}
Factory hands a command the clients it needs. There is one implementation against a real cluster, built from the kubectl configuration flags; tests supply their own so that no test reaches a cluster.
func NewFactory ¶
func NewFactory(configFlags *genericclioptions.ConfigFlags) Factory
NewFactory returns the Factory that talks to the cluster the configuration flags point at. The REST configuration and the clients are built once and reused, so a command that needs two of them does not read the kubeconfig twice.
type Options ¶
type Options struct {
ConfigFlags *genericclioptions.ConfigFlags
Streams genericiooptions.IOStreams
Factory Factory
// Debug reports whether debug-level logging was asked for, by --debug, -d or
// the DEBUG environment variable.
Debug bool
// Logger is where commands report progress. It writes to the error stream
// only, so stdout stays the command's own output.
Logger *output.Logger
}
Options is the state the root command resolves once and every subcommand reads.
func (*Options) KubeconfigDisplay ¶
KubeconfigDisplay names the kubeconfig the clients will be built from, for reporting it to the user. It asks the client configuration rather than resolving a path of its own: a second resolver can disagree with the one that actually loads the file, and then the gather names a cluster it never looked at.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adm carries the admin-level operations on the NVIDIA resources of a cluster.
|
Package adm carries the admin-level operations on the NVIDIA resources of a cluster. |
|
Package root builds the kubectl-nv command tree.
|
Package root builds the kubectl-nv command tree. |