Documentation ¶
Index ¶
- Constants
- func AnonymousClientConfig(config *restclient.Config) restclient.Config
- func BindClientConfigSecurityFlags(config *restclient.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 CachedDiscoveryClient
- func (d *CachedDiscoveryClient) ServerGroups() (*unversioned.APIGroupList, error)
- func (d *CachedDiscoveryClient) ServerResources() (map[string]*unversioned.APIResourceList, error)
- func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error)
- type Config
- type Factory
- func (w *Factory) ApproximatePodTemplateForObject(object runtime.Object) (*api.PodTemplateSpec, error)
- func (f *Factory) Clients() (*client.Client, *kclient.Client, error)
- func (f *Factory) OriginSwaggerSchema(client *restclient.RESTClient, version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)
- func (f *Factory) UpdateObjectEnvironment(obj runtime.Object, fn func(*[]api.EnvVar) error) (bool, 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) 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
func AnonymousClientConfig(config *restclient.Config) restclient.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 *restclient.Config, flags *pflag.FlagSet)
BindClientConfigSecurityFlags adds flags for the supplied client config
func DefaultClientConfig ¶ added in v0.3.2
func DefaultClientConfig(flags *pflag.FlagSet) clientcmd.ClientConfig
func DefaultGenerators ¶ added in v1.1.3
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 CachedDiscoveryClient ¶ added in v1.1.4
type CachedDiscoveryClient struct { discovery.DiscoveryInterface // contains filtered or unexported fields }
CachedDiscoveryClient implements the functions that dicovery server-supported API groups, versions and resources.
func NewCachedDiscoveryClient ¶ added in v1.1.4
func NewCachedDiscoveryClient(delegate discovery.DiscoveryInterface, cacheDirectory string, ttl time.Duration) *CachedDiscoveryClient
NewCachedDiscoveryClient creates a new DiscoveryClient. cacheDirectory is the directory where discovery docs are held. It must be unique per host:port combination to work well.
func (*CachedDiscoveryClient) ServerGroups ¶ added in v1.1.4
func (d *CachedDiscoveryClient) ServerGroups() (*unversioned.APIGroupList, error)
func (*CachedDiscoveryClient) ServerResources ¶ added in v1.1.4
func (d *CachedDiscoveryClient) ServerResources() (map[string]*unversioned.APIResourceList, error)
ServerResources returns the supported resources for all groups and versions.
func (*CachedDiscoveryClient) ServerResourcesForGroupVersion ¶ added in v1.1.4
func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error)
ServerResourcesForGroupVersion returns the supported resources for a group and version.
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 restclient.Config // Namespace is the namespace to act in Namespace string // If set, allow kubeconfig file loading FromFile bool // If true, no environment is loaded (for testing, primarily) SkipEnv bool // contains filtered or unexported fields }
Config contains all the necessary bits for client configuration
func (*Config) BindToFile ¶ added in v1.1.4
BindToFile is used when this config will not be bound to flags, but should load the config file from disk if available.
func (*Config) Clients ¶
Clients returns an OpenShift and a Kubernetes client from a given configuration
func (*Config) KubeConfig ¶
func (cfg *Config) KubeConfig() *restclient.Config
KubeConfig returns the Kubernetes configuration
func (*Config) OpenShiftConfig ¶
func (cfg *Config) OpenShiftConfig() *restclient.Config
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
func (*Factory) ApproximatePodTemplateForObject ¶ added in v1.1.4
func (w *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 avaliable at the current time.
func (*Factory) OriginSwaggerSchema ¶ added in v1.1.3
func (f *Factory) OriginSwaggerSchema(client *restclient.RESTClient, version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)
OriginSwaggerSchema returns a swagger API doc for an Origin schema under the /oapi prefix.
type ShortcutExpander ¶ added in v0.3.2
type ShortcutExpander struct { RESTMapper meta.RESTMapper All []string }
ShortcutExpander is a RESTMapper that can be used for OpenShift resources. It expands the resource first, then invokes the wrapped
func NewShortcutExpander ¶ added in v1.1.4
func NewShortcutExpander(discoveryClient discovery.DiscoveryInterface, delegate meta.RESTMapper) ShortcutExpander
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 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) 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)