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 DefaultGenerators(cmdName string) map[string]kubectl.Generator
- 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
- func (f *Factory) Clients() (*client.Client, *kclient.Client, error)
- func (f *Factory) OriginSwaggerSchema(client *kclient.RESTClient, version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)
- func (f *Factory) UpdatePodSpecForObject(obj runtime.Object, fn func(*api.PodSpec) error) (bool, error)
- type ShortcutExpander
- func (e ShortcutExpander) AliasesForResource(resource string) ([]string, bool)
- func (e ShortcutExpander) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, error)
- func (e ShortcutExpander) KindsFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, error)
- func (e ShortcutExpander) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (e ShortcutExpander) ResourceFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionResource, error)
- func (e ShortcutExpander) ResourceIsValid(resource unversioned.GroupVersionResource) bool
- func (e ShortcutExpander) ResourceSingularizer(resource string) (string, error)
- func (e ShortcutExpander) ResourcesFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error)
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 ¶
func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig
func DefaultGenerators ¶ added in v1.1.3
func GetPrettyMessageFor ¶
GetPrettyMessageFor prettifys the message of the provided error
func IsCertificateAuthorityUnknown ¶
IsCertificateAuthorityUnknown checks whether the provided error is a 'certificate authority unknown' error or not
func IsConfigurationInvalid ¶
IsConfigurationInvalid checks whether the provided error is a 'invalid configuration' error or not
func IsForbidden ¶
IsForbidden checks whether the provided error is a 'forbidden' error or not
func IsNoServerFound ¶
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 ¶
type Factory struct { *cmdutil.Factory OpenShiftClientConfig kclientcmd.ClientConfig // contains filtered or unexported fields }
Factory provides common options for OpenShift commands
func New ¶
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) 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.
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 (e ShortcutExpander) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, error)
func (ShortcutExpander) KindsFor ¶ added in v1.1.3
func (e ShortcutExpander) KindsFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, error)
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 (e ShortcutExpander) ResourceFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionResource, error)
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
func (e ShortcutExpander) ResourcesFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error)