Documentation ¶
Index ¶
- Constants
- func AnonymousClientConfig(config kclient.Config) kclient.Config
- func BindClientConfigSecurityFlags(config *kclient.Config, flags *pflag.FlagSet)
- func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig
- func EnvVars(host string, caData []byte, insecure bool, bearerTokenFile string) []api.EnvVar
- func GetPrettyMessageFor(err error) string
- func IsCertificateAuthorityUnknown(err error) bool
- func IsConfigurationInvalid(err error) bool
- func IsForbidden(err error) bool
- func IsNoServerFound(err error) bool
- type Config
- type Factory
- type ShortcutExpander
Constants ¶
const ConfigSyntax = " --master=<addr>"
Variables ¶
This section is empty.
Functions ¶
func AnonymousClientConfig ¶ added in v1.0.7
AnonymousClientConfig returns a copy of the given config with all user credentials (cert/key, bearer token, and username/password) removed
func BindClientConfigSecurityFlags ¶
BindClientConfigSecurityFlags adds flags for the supplied client config
func DefaultClientConfig ¶ added in v0.3.2
func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig
func GetPrettyMessageFor ¶ added in v0.4.2
GetPrettyMessageFor prettifys the message of the provided error
func IsCertificateAuthorityUnknown ¶ added in v0.4.2
IsCertificateAuthorityUnknown checks whether the provided error is a 'certificate authority unknown' error or not
func IsConfigurationInvalid ¶ added in v0.4.4
IsConfigurationInvalid checks whether the provided error is a 'invalid configuration' error or not
func IsForbidden ¶ added in v0.4.2
IsForbidden checks whether the provided error is a 'forbidden' error or not
func IsNoServerFound ¶ added in v0.4.2
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 (*Config) Clients ¶
Clients returns an OpenShift and a Kubernetes client from a given configuration
func (*Config) KubeConfig ¶
KubeConfig returns the Kubernetes configuration
func (*Config) OpenShiftConfig ¶
OpenShiftConfig returns the OpenShift configuration
type Factory ¶ added in v0.3.2
type Factory struct { *cmdutil.Factory OpenShiftClientConfig kclientcmd.ClientConfig // contains filtered or unexported fields }
Factory provides common options for OpenShift commands
func New ¶ added in v0.3.2
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 ¶ added in v0.3.2
func NewFactory(clientConfig kclientcmd.ClientConfig) *Factory
NewFactory creates an object that holds common methods across all OpenShift commands
type ShortcutExpander ¶ added in v0.3.2
type ShortcutExpander struct {
meta.RESTMapper
}
ShortcutExpander is a RESTMapper that can be used for OpenShift resources.
func (ShortcutExpander) AliasesForResource ¶ added in v0.4.4
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 (e ShortcutExpander) KindFor(resource string) (unversioned.GroupVersionKind, error)
KindFor implements meta.RESTMapper. It expands the resource first, then invokes the wrapped mapper.
func (ShortcutExpander) ResourceIsValid ¶ added in v1.0.7
func (e ShortcutExpander) ResourceIsValid(resource string) bool
ResourceIsValid takes a string (kind) and checks if it's a valid resource. It expands the resource first, then invokes the wrapped mapper.