Documentation ¶
Overview ¶
Package kubernetes provides the functionality to access and manipulate Kubernetes objects.
Index ¶
- func CurrentContext(configPath string) (string, error)
- func DeleteContext(configPath, ctxName string) error
- func SetContext(configPath, ctxName string) error
- type Client
- func (c *Client) Apply(ctx context.Context, data *bytes.Buffer) error
- func (c *Client) Deploy(ctx context.Context, envDesc *fs.EnvDescription) error
- func (c *Client) GetN(ctx context.Context, namespace string, opts *metav1.ListOptions) (int, error)
- func (c *Client) Wait(ctx context.Context, wc *WaitCondition) error
- type WaitCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentContext ¶
CurrentContext returns the name of currently active Kubernetes context. configPath is the path to Kubeconfig.
func DeleteContext ¶
DeleteContext removes the provided context. configPath is the path to Kubeconfig. It is modified by this function.
func SetContext ¶
SetContext changes active context to the required one. configPath is the path to Kubeconfig. It is modified by this function.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client encapsulates the key structures of Kubernetes libraries that are used to access Kubernetes.
func (*Client) Deploy ¶
Deploy deploys the initial environment as described in envDesc, taking care of kustomize specifics if needed.
type WaitCondition ¶
type WaitCondition struct {
// contains filtered or unexported fields
}
WaitCondition indicates how long to wait
func NewWaitCondition ¶
func NewWaitCondition(conditionArg interface{}) (wc *WaitCondition, err error)
NewWaitCondition constructs WaitCondition from provided configuration.
func (*WaitCondition) Build ¶
func (wc *WaitCondition) Build()
Build builds internal logic for WaitCondition.
func (*WaitCondition) DeriveType ¶
func (wc *WaitCondition) DeriveType()
DeriveType decides the type of WaitCondition.
func (*WaitCondition) TimeParams ¶
func (wc *WaitCondition) TimeParams(interval, timeout time.Duration)
TimeParams sets time parameters.
func (*WaitCondition) Validate ¶
func (wc *WaitCondition) Validate() bool
Validate checks if WaitCondition makes sense.