kubernetes: github.com/igm/kubernetes/pkg/kubectl/cmd Index | Files

package cmd

import "github.com/igm/kubernetes/pkg/kubectl/cmd"

Index

Package Files

cmd.go create.go createall.go delete.go describe.go get.go helpers.go log.go namespace.go proxy.go resource.go update.go version.go

func CompareNamespaceFromFile Uses

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 Uses

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

DataToObjects converts the raw JSON data into API objects

func FirstNonEmptyString Uses

func FirstNonEmptyString(args ...string) string

Returns the first non-empty string out of the ones provided. If all strings are empty, returns an empty string.

func GetFilesFromDir Uses

func GetFilesFromDir(directory string, fileType string) []string

Return a list of file names of a certain type within a given directory.

func GetFlagBool Uses

func GetFlagBool(cmd *cobra.Command, flag string) bool

func GetFlagBoolPtr Uses

func GetFlagBoolPtr(cmd *cobra.Command, flag string) *bool

Returns nil if the flag wasn't set.

func GetFlagInt Uses

func GetFlagInt(cmd *cobra.Command, flag string) int

Assumes the flag has a default value.

func GetFlagString Uses

func GetFlagString(cmd *cobra.Command, flag string) string

func NewCmdNamespace Uses

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

func ReadConfigData Uses

func ReadConfigData(location string) ([]byte, error)

ReadConfigData reads the bytes from the specified filesytem or network location or from stdin if location == "-".

func ReadConfigDataFromLocation Uses

func ReadConfigDataFromLocation(location string) ([]byte, error)

func ResourceFromArgs Uses

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 Uses

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 Uses

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 Uses

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.

type Factory Uses

type Factory struct {
    ClientBuilder clientcmd.Builder
    Mapper        meta.RESTMapper
    Typer         runtime.ObjectTyper
    Client        func(cmd *cobra.Command, mapping *meta.RESTMapping) (kubectl.RESTClient, error)
    Describer     func(cmd *cobra.Command, mapping *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 Uses

func NewFactory(clientBuilder clientcmd.Builder) *Factory

NewFactory creates a factory with the default Kubernetes resources defined

func (*Factory) NewCmdCreate Uses

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

func (*Factory) NewCmdCreateAll Uses

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

func (*Factory) NewCmdDelete Uses

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

func (*Factory) NewCmdDescribe Uses

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

func (*Factory) NewCmdGet Uses

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

func (*Factory) NewCmdLog Uses

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

func (*Factory) NewCmdProxy Uses

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

func (*Factory) NewCmdUpdate Uses

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

func (*Factory) NewCmdVersion Uses

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

func (*Factory) Run Uses

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

Package cmd imports 20 packages (graph). Updated 2018-04-17. Refresh now. Tools for package owners.