cmd

package
v0.0.0-...-3155cad Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2014 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareNamespaceFromFile

func CompareNamespaceFromFile(cmd *cobra.Command, namespace string) error

CompareNamespaceFromFile returns an error if the namespace the user has provided on the CLI or via the default namespace file does not match the namespace of an input file. This prevents a user from unintentionally updating the wrong namespace.

func DataToObjects

func DataToObjects(m meta.RESTMapper, t runtime.ObjectTyper, data []byte) (result []runtime.Object, errors errs.ValidationErrorList)

DataToObjects converts the raw JSON data into API objects

func NewCmdCreateAll

func NewCmdCreateAll(out io.Writer) *cobra.Command

func NewCmdLog

func NewCmdLog(out io.Writer) *cobra.Command

func NewCmdNamespace

func NewCmdNamespace(out io.Writer) *cobra.Command

func NewCmdProxy

func NewCmdProxy(out io.Writer) *cobra.Command

func NewCmdVersion

func NewCmdVersion(out io.Writer) *cobra.Command

func ResourceFromArgs

func ResourceFromArgs(cmd *cobra.Command, args []string, mapper meta.RESTMapper) (mapping *meta.RESTMapping, namespace, name string)

ResourceFromArgs expects two arguments with a given type, and extracts the fields necessary to uniquely locate a resource. Displays a usageError if that contract is not satisfied, or a generic error if any other problems occur.

func ResourceFromArgsOrFile

func ResourceFromArgsOrFile(cmd *cobra.Command, args []string, filename string, typer runtime.ObjectTyper, mapper meta.RESTMapper) (mapping *meta.RESTMapping, namespace, name string)

ResourceFromArgsOrFile expects two arguments or a valid file with a given type, and extracts the fields necessary to uniquely locate a resource. Displays a usageError if that contract is not satisfied, or a generic error if any other problems occur.

func ResourceFromFile

func ResourceFromFile(filename string, typer runtime.ObjectTyper, mapper meta.RESTMapper) (mapping *meta.RESTMapping, namespace, name string, data []byte)

ResourceFromFile retrieves the name and namespace from a valid file. If the file does not resolve to a known type an error is returned. The returned mapping can be used to determine the correct REST endpoint to modify this resource with.

func ResourceOrTypeFromArgs

func ResourceOrTypeFromArgs(cmd *cobra.Command, args []string, mapper meta.RESTMapper) (mapping *meta.RESTMapping, namespace, name string)

ResourceFromArgs expects two arguments with a given type, and extracts the fields necessary to uniquely locate a resource. Displays a usageError if that contract is not satisfied, or a generic error if any other problems occur.

Types

type Factory

type Factory struct {
	Mapper    meta.RESTMapper
	Typer     runtime.ObjectTyper
	Client    func(*cobra.Command, *meta.RESTMapping) (kubectl.RESTClient, error)
	Describer func(*cobra.Command, *meta.RESTMapping) (kubectl.Describer, error)
	Printer   func(cmd *cobra.Command, mapping *meta.RESTMapping, noHeaders bool) (kubectl.ResourcePrinter, error)
}

Factory provides abstractions that allow the Kubectl command to be extended across multiple types of resources and different API sets.

func NewFactory

func NewFactory() *Factory

NewFactory creates a factory with the default Kubernetes resources defined

func (*Factory) NewCmdCreate

func (f *Factory) NewCmdCreate(out io.Writer) *cobra.Command

func (*Factory) NewCmdDelete

func (f *Factory) NewCmdDelete(out io.Writer) *cobra.Command

func (*Factory) NewCmdDescribe

func (f *Factory) NewCmdDescribe(out io.Writer) *cobra.Command

func (*Factory) NewCmdGet

func (f *Factory) NewCmdGet(out io.Writer) *cobra.Command

func (*Factory) NewCmdUpdate

func (f *Factory) NewCmdUpdate(out io.Writer) *cobra.Command

func (*Factory) Run

func (f *Factory) Run(out io.Writer)

Jump to

Keyboard shortcuts

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