kubernetes

package
v0.0.0-...-80bb616 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Package kubernetes provides the functionality to access and manipulate Kubernetes objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentContext

func CurrentContext(configPath string) (string, error)

CurrentContext returns the name of currently active Kubernetes context. configPath is the path to Kubeconfig.

func DeleteContext

func DeleteContext(configPath, ctxName string) error

DeleteContext removes the provided context. configPath is the path to Kubeconfig. It is modified by this function.

func SetContext

func SetContext(configPath, ctxName string) error

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 NewClient

func NewClient(_ context.Context, configPath string) (*Client, error)

NewClient constructs the Client.

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, data *bytes.Buffer) error

Apply deploys the manifest in data.

func (*Client) Deploy

func (c *Client) Deploy(ctx context.Context, envDesc *fs.EnvDescription) error

Deploy deploys the initial environment as described in envDesc, taking care of kustomize specifics if needed.

func (*Client) GetN

func (c *Client) GetN(ctx context.Context, namespace string, opts *metav1.ListOptions) (int, error)

GetN is a hopefully temporary substitute for Get

func (*Client) Wait

func (c *Client) Wait(ctx context.Context, wc *WaitCondition) error

Wait blocks execution until wait condition is fulfilled.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL