client

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sClient

type K8sClient struct {
	// contains filtered or unexported fields
}

func NewK8sClientWithKubeConfig

func NewK8sClientWithKubeConfig(kubeconfigFile string) (*K8sClient, error)

NewK8sClientWithKubeConfig creates kubernetes client wrapper with the specified kubeconfig file

func NewK8sClientWithToken

func NewK8sClientWithToken(baseKubeConfig, token string) (*K8sClient, error)

NewK8sClientWithKubeConfig creates kubernetes client wrapper with the token

func (*K8sClient) AssignRoleToSA

func (w *K8sClient) AssignRoleToSA(namespace, serviceAccount, role string) error

func (*K8sClient) CreateNamespace

func (w *K8sClient) CreateNamespace(namespace string) error

CreateNamespace creates a new namespace

func (*K8sClient) CreateSA

func (w *K8sClient) CreateSA(name, namespace string) error

func (*K8sClient) DeleteNamespace

func (w *K8sClient) DeleteNamespace(namespace string) error

DeleteNamespace deletes a namespace

func (*K8sClient) ExecCommandInContainer

func (w *K8sClient) ExecCommandInContainer(podName string, namespace, commandInContainer string) (output string, err error)

launch 'exec' oc command in the defined pod and container

func (*K8sClient) GetDevWsStatus

func (w *K8sClient) GetDevWsStatus(name, namespace string) (*dw.DevWorkspaceStatus, error)

get workspace current dev workspace status from the Custom Resource object

func (*K8sClient) GetPodNameBySelector

func (w *K8sClient) GetPodNameBySelector(selector, namespace string) (string, error)

GetPodNameBySelector returns the pod name that matches selector error is returned when

func (*K8sClient) Kube

func (c *K8sClient) Kube() kubernetes.Interface

Kube returns the clientset for Kubernetes upstream.

func (*K8sClient) ListPods

func (w *K8sClient) ListPods(namespace, selector string) (*v1.PodList, error)

Returns the list of currently scheduled or running pods in `namespace` with the given selector

func (*K8sClient) OcApplyWorkspace

func (w *K8sClient) OcApplyWorkspace(namespace string, filePath string) (commandResult string, err error)

func (*K8sClient) WaitDevWsStatus

func (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus dw.DevWorkspacePhase) (bool, error)

func (*K8sClient) WaitForMutatingWebhooksConfigurations

func (w *K8sClient) WaitForMutatingWebhooksConfigurations(name string) (deployed bool, err error)

func (*K8sClient) WaitForPodRunningByLabel

func (w *K8sClient) WaitForPodRunningByLabel(namespace, label string) (deployed bool, err error)

func (*K8sClient) WaitForRunningPodBySelector

func (w *K8sClient) WaitForRunningPodBySelector(namespace, selector string, timeout time.Duration) error

Wait up to timeout seconds for all pods in 'namespace' with given 'selector' to enter running state. Returns an error if no pods are found or not all discovered pods enter running state.

func (*K8sClient) WaitNamespaceIsTerminated

func (w *K8sClient) WaitNamespaceIsTerminated(namespace string) (err error)

WaitNamespaceIsTerminated waits until namespace that is marked to be removed, is fully cleaned up

func (*K8sClient) WaitSAToken

func (w *K8sClient) WaitSAToken(namespace, serviceAccount string) (token string, err error)

WaitSAToken waits until a secret with the token related to the specified SA error is returned if token is not found after 10 seconds of tries

Jump to

Keyboard shortcuts

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