Documentation
¶
Index ¶
- func BuildRESTConfig(context, kubeconfig string) (*rest.Config, error)
- type Client
- func (c *Client) Apply(content []byte) error
- func (c *Client) ApplyFile(filename string) error
- func (c *Client) ApplyNamespace(namespace string) error
- func (c *Client) Builder() *resource.Builder
- func (c *Client) Create(content []byte) error
- func (c *Client) CreateFile(filename string) error
- func (c *Client) CreateNamespace(namespace string) error
- func (c *Client) Namespace(namespace string) (*v1.Namespace, error)
- func (c *Client) ResultForContent(content []byte, unstructured bool) *resource.Result
- func (c *Client) ResultForFilenameParam(filenames []string, unstructured bool) *resource.Result
- func (c *Client) ResultForReader(r io.Reader, unstructured bool) *resource.Result
- func (c *Client) UnstructuredBuilder() *resource.Builder
- type Config
- func (c *Config) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
- func (c *Config) DynamicClient() (dynamic.Interface, error)
- func (c *Config) KubernetesClientSet() (*kubernetes.Clientset, error)
- func (c *Config) NewBuilder() *resource.Builder
- func (c *Config) OpenAPISchema() (openapi.Resources, error)
- func (c *Config) RESTClient() (*rest.RESTClient, error)
- func (c *Config) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (c *Config) ToRESTConfig() (*rest.Config, error)
- func (c *Config) ToRESTMapper() (meta.RESTMapper, error)
- func (c *Config) ToRawKubeConfigLoader() clientcmd.ClientConfig
- func (c *Config) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
- func (c *Config) Validator(validate bool) (validation.Schema, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Config *Config // contains filtered or unexported fields }
Client is a kubernetes client, like `kubectl`
func NewClientE ¶
NewClientE creates a kubernetes client, returns an error if fail
func (*Client) ApplyNamespace ¶
ApplyNamespace creates the given namespace if does not exists
func (*Client) CreateFile ¶
CreateFile creates a resource with the given content
func (*Client) CreateNamespace ¶
CreateNamespace creates a namespace with the given name
func (*Client) Namespace ¶
Namespace returns the namespace with the given name. If not found returns a IsNotFound error
func (*Client) ResultForContent ¶
ResultForContent returns the builder results for the given content
func (*Client) ResultForFilenameParam ¶
ResultForFilenameParam returns the builder results for the given list of files or URLs
func (*Client) ResultForReader ¶
ResultForReader returns the builder results for the given reader
func (*Client) UnstructuredBuilder ¶
UnstructuredBuilder creates an unstructure builder for the given namespace
type Config ¶
Config is the client configuration. It implements RESTClientGetter
func (*Config) ClientForMapping ¶
func (c *Config) ClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
ClientForMapping creates a resource REST client from the given mappings
func (*Config) DynamicClient ¶
DynamicClient creates a dynamic client from the configuration
func (*Config) KubernetesClientSet ¶
func (c *Config) KubernetesClientSet() (*kubernetes.Clientset, error)
KubernetesClientSet creates a kubernetes clientset from the configuration
func (*Config) NewBuilder ¶
NewBuilder returns a new resource builder for structured api objects.
func (*Config) OpenAPISchema ¶
OpenAPISchema returns metadata and structural information about Kubernetes object definitions.
func (*Config) RESTClient ¶
func (c *Config) RESTClient() (*rest.RESTClient, error)
RESTClient creates a REST client from the configuration
func (*Config) ToDiscoveryClient ¶
func (c *Config) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
ToDiscoveryClient returns a CachedDiscoveryInterface using a computed RESTConfig
func (*Config) ToRESTConfig ¶
ToRESTConfig creates a kubernetes REST client config
func (*Config) ToRESTMapper ¶
func (c *Config) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper returns a mapper
func (*Config) ToRawKubeConfigLoader ¶
func (c *Config) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader creates a client config using the following rules: 1. builds from the given kubeconfig path, if not empty 2. use the in cluster config if running in-cluster 3. gets the config from KUBECONFIG env var 4. Uses $HOME/.kube/config
func (*Config) UnstructuredClientForMapping ¶
func (c *Config) UnstructuredClientForMapping(mapping *meta.RESTMapping) (resource.RESTClient, error)
UnstructuredClientForMapping creates a unstructured resource REST client from the given mappings