Documentation ¶
Index ¶
- func GetConfig(c *Client) (*rest.Config, error)
- type Client
- func (c *Client) Clientset() (*kubernetes.Clientset, error)
- func (c *Client) Config() (config *rest.Config, err error)
- func (c *Client) ConfigForPath(kubeConfigPath string) (config *rest.Config, err error)
- func (c *Client) Dynamic() (dynamic.Interface, error)
- func (c *Client) GetConfigForPathOrDirect() (config *rest.Config, err error)
- type GetConfigFunc
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { IsInCluster bool // flag to let client point to its own cluster KubeConfigPath string // kubeconfig path to get kubernetes clientset // contains filtered or unexported fields }
Client provides common kuberenetes client operations
func Instance ¶
func Instance(opts ...OptionFunc) *Client
Instance returns a singleton instance of this client
func (*Client) Clientset ¶
func (c *Client) Clientset() (*kubernetes.Clientset, error)
Clientset returns a new instance of kubernetes clientset
func (*Client) ConfigForPath ¶
ConfigForPath returns the kubernetes config instance based on KubeConfig path
type GetConfigFunc ¶
GetConfigFunc provides the abstraction to get kubernetes config from provided client instance
NOTE:
typed function makes it simple to mock
type OptionFunc ¶
type OptionFunc func(*Client)
OptionFunc is a typed function that abstracts any kind of operation against the provided client instance
This is the basic building block to create functional operations against the client instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(kubeConfigPath string) OptionFunc
WithKubeConfigPath sets kubeconfig path against this client instance
Click to show internal directories.
Click to hide internal directories.