clientcmd

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2016 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigSyntax = " --master=<addr>"

Variables

This section is empty.

Functions

func AnonymousClientConfig added in v1.0.7

func AnonymousClientConfig(config kclient.Config) kclient.Config

AnonymousClientConfig returns a copy of the given config with all user credentials (cert/key, bearer token, and username/password) removed

func BindClientConfigSecurityFlags

func BindClientConfigSecurityFlags(config *kclient.Config, flags *pflag.FlagSet)

BindClientConfigSecurityFlags adds flags for the supplied client config

func DefaultClientConfig

func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig

func DefaultGenerators added in v1.1.3

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

func EnvVars

func EnvVars(host string, caData []byte, insecure bool, bearerTokenFile string) []api.EnvVar

func GetPrettyMessageFor

func GetPrettyMessageFor(err error) string

GetPrettyMessageFor prettifys the message of the provided error

func IsCertificateAuthorityUnknown

func IsCertificateAuthorityUnknown(err error) bool

IsCertificateAuthorityUnknown checks whether the provided error is a 'certificate authority unknown' error or not

func IsConfigurationInvalid

func IsConfigurationInvalid(err error) bool

IsConfigurationInvalid checks whether the provided error is a 'invalid configuration' error or not

func IsForbidden

func IsForbidden(err error) bool

IsForbidden checks whether the provided error is a 'forbidden' error or not

func IsNoServerFound

func IsNoServerFound(err error) bool

IsNoServerFound checks whether the provided error is a 'no server found' error or not

Types

type Config

type Config struct {
	// MasterAddr is the address the master can be reached on (host, host:port, or URL).
	MasterAddr flagtypes.Addr
	// KubernetesAddr is the address of the Kubernetes server (host, host:port, or URL).
	// If omitted defaults to the master.
	KubernetesAddr flagtypes.Addr
	// CommonConfig is the shared base config for both the OpenShift config and Kubernetes config
	CommonConfig kclient.Config
	// Namespace is the namespace to act in
	Namespace string

	// If set, allow kubeconfig file loading
	FromFile bool
	// contains filtered or unexported fields
}

Config contains all the necessary bits for client configuration

func NewConfig

func NewConfig() *Config

NewConfig returns a new configuration

func (*Config) Bind

func (cfg *Config) Bind(flags *pflag.FlagSet)

Bind binds configuration values to the passed flagset

func (*Config) Clients

func (cfg *Config) Clients() (osclient.Interface, kclient.Interface, error)

Clients returns an OpenShift and a Kubernetes client from a given configuration

func (*Config) KubeConfig

func (cfg *Config) KubeConfig() *kclient.Config

KubeConfig returns the Kubernetes configuration

func (*Config) OpenShiftConfig

func (cfg *Config) OpenShiftConfig() *kclient.Config

OpenShiftConfig returns the OpenShift configuration

type Factory

type Factory struct {
	*cmdutil.Factory
	OpenShiftClientConfig kclientcmd.ClientConfig
	// contains filtered or unexported fields
}

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(clientConfig kclientcmd.ClientConfig) *Factory

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

func (*Factory) Clients

func (f *Factory) Clients() (*client.Client, *kclient.Client, error)

Clients returns an OpenShift and Kubernetes client.

func (*Factory) OriginSwaggerSchema added in v1.1.3

func (f *Factory) OriginSwaggerSchema(client *kclient.RESTClient, version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)

OriginSwaggerSchema returns a swagger API doc for an Origin schema under the /oapi prefix.

func (*Factory) UpdatePodSpecForObject

func (f *Factory) UpdatePodSpecForObject(obj runtime.Object, fn func(*api.PodSpec) error) (bool, error)

UpdatePodSpecForObject update the pod specification for the provided object TODO: move to upstream

type ShortcutExpander

type ShortcutExpander struct {
	RESTMapper meta.RESTMapper
}

ShortcutExpander is a RESTMapper that can be used for OpenShift resources. It expands the resource first, then invokes the wrapped

func (ShortcutExpander) AliasesForResource

func (e ShortcutExpander) AliasesForResource(resource string) ([]string, bool)

AliasesForResource returns whether a resource has an alias or not

func (ShortcutExpander) KindFor added in v1.1.2

func (ShortcutExpander) KindsFor added in v1.1.3

func (ShortcutExpander) RESTMapping added in v1.1.3

func (e ShortcutExpander) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error)

func (ShortcutExpander) ResourceFor added in v1.1.3

func (ShortcutExpander) ResourceIsValid added in v1.0.7

func (e ShortcutExpander) ResourceIsValid(resource unversioned.GroupVersionResource) bool

func (ShortcutExpander) ResourceSingularizer added in v1.1.3

func (e ShortcutExpander) ResourceSingularizer(resource string) (string, error)

func (ShortcutExpander) ResourcesFor added in v1.1.3

Jump to

Keyboard shortcuts

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