clientcmd

package
v3.10.0-0.35.0+incompa... Latest Latest
Warning

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

Go to latest
Published: May 6, 2018 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsVersionedObject

func AsVersionedObject(infos []*resource.Info, forceList bool, version schema.GroupVersion, encoder runtime.Encoder) (runtime.Object, error)

AsVersionedObject converts a list of infos into a single object - either a List containing the objects as children, or if only a single Object is present, as that object. The provided version will be preferred as the conversion target, but the Object's mapping version will be used if that version is not present.

func AsVersionedObjects

func AsVersionedObjects(infos []*resource.Info, version schema.GroupVersion, encoder runtime.Encoder) ([]runtime.Object, error)

AsVersionedObjects converts a list of infos into versioned objects. The provided version will be preferred as the conversion target, but the Object's mapping version will be used if that version is not present.

func ConvertExteralPodSpecToInternal

func ConvertExteralPodSpecToInternal(inFn func(*corev1.PodSpec) error) func(*kapi.PodSpec) error

func ConvertInteralPodSpecToExternal

func ConvertInteralPodSpecToExternal(inFn func(*kapi.PodSpec) error) func(*corev1.PodSpec) error

func DefaultGenerators

func DefaultGenerators(cmdName string) map[string]kubectl.Generator

func FindAllCanonicalResources

func FindAllCanonicalResources(d discovery.DiscoveryInterface, m meta.RESTMapper) ([]schema.GroupResource, error)

FindAllCanonicalResources returns all resource names that map directly to their kind (Kind -> Resource -> Kind) and are not subresources. This is the closest mapping possible from the client side to resources that can be listed and updated. Note that this may return some virtual resources (like imagestreamtags) that can be otherwise represented. TODO: add a field to APIResources for "virtual" (or that points to the canonical resource). TODO: fallback to the scheme when discovery is not possible.

func NewBuilderFactory

func NewBuilderFactory(clientAccessFactory kcmdutil.ClientAccessFactory, objectMappingFactory kcmdutil.ObjectMappingFactory) kcmdutil.BuilderFactory

func NewClientAccessFactory

func NewClientAccessFactory(optionalClientConfig kclientcmd.ClientConfig) kcmdutil.ClientAccessFactory

func NewObjectMappingFactory

func NewObjectMappingFactory(clientAccessFactory kcmdutil.ClientAccessFactory) kcmdutil.ObjectMappingFactory

func ParseDockerImageReferenceToStringFunc

func ParseDockerImageReferenceToStringFunc(spec string) (string, error)

func ResourceMapper

func ResourceMapper(f kcmdutil.Factory) *resource.Mapper

Types

type Factory

Factory provides common options for OpenShift commands

func New

func New(flags *pflag.FlagSet) *Factory

New creates a default Factory for commands that should share identical server connection behavior. Most commands should use this method to get a factory.

func NewFactory

func NewFactory(optionalClientConfig kclientcmd.ClientConfig) *Factory

NewFactory creates an object that holds common methods across all OpenShift commands

func (*Factory) ApproximatePodTemplateForObject

func (f *Factory) ApproximatePodTemplateForObject(object runtime.Object) (*api.PodTemplateSpec, error)

ApproximatePodTemplateForObject returns a pod template object for the provided source. It may return both an error and a object. It attempt to return the best possible template available at the current time.

func (*Factory) ExtractFileContents

func (f *Factory) ExtractFileContents(obj runtime.Object) (map[string][]byte, bool, error)

ExtractFileContents returns a map of keys to contents, false if the object cannot support such an operation, or an error.

func (*Factory) PodForResource

func (f *Factory) PodForResource(resource string, timeout time.Duration) (string, error)

func (*Factory) PrintResourceInfos

func (f *Factory) PrintResourceInfos(cmd *cobra.Command, isLocal bool, infos []*resource.Info, out io.Writer) error

PrintResourceInfos receives a list of resource infos and prints versioned objects if a generic output format was specified otherwise, it iterates through info objects, printing each resource with a unique printer for its mapping

func (*Factory) UpdateObjectEnvironment

func (f *Factory) UpdateObjectEnvironment(obj runtime.Object, fn func(*[]api.EnvVar) error) (bool, error)

UpdateObjectEnvironment update the environment variables in object specification.

type FlagBinder

type FlagBinder interface {
	// Bound returns true if the flag is already bound to a command.
	Bound() bool
	// Bind allows to bind an extra flag to a command
	Bind(*pflag.FlagSet)
}

FlagBinder represents an interface that allows to bind extra flags into commands.

Jump to

Keyboard shortcuts

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