Documentation
¶
Index ¶
- type K8sClient
- func (w *K8sClient) AssignRoleToSA(namespace, serviceAccount, role string) error
- func (w *K8sClient) CreateNamespace(namespace string) error
- func (w *K8sClient) CreateSA(name, namespace string) error
- func (w *K8sClient) DeleteNamespace(namespace string) error
- func (w *K8sClient) ExecCommandInContainer(podName string, namespace, commandInContainer string) (output string, err error)
- func (w *K8sClient) GetDevWsStatus(name, namespace string) (*workspacev1alpha2.WorkspacePhase, error)
- func (w *K8sClient) GetPodNameBySelector(selector, namespace string) (string, error)
- func (c *K8sClient) Kube() kubernetes.Interface
- func (w *K8sClient) ListPods(namespace, selector string) (*v1.PodList, error)
- func (w *K8sClient) OcApplyWorkspace(namespace string, filePath string) (commandResult string, err error)
- func (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus workspacev1alpha2.WorkspacePhase) (bool, error)
- func (w *K8sClient) WaitForMutatingWebhooksConfigurations(name string) (deployed bool, err error)
- func (w *K8sClient) WaitForPodRunningByLabel(namespace, label string) (deployed bool, err error)
- func (w *K8sClient) WaitForRunningPodBySelector(namespace, selector string, timeout time.Duration) error
- func (w *K8sClient) WaitNamespaceIsTerminated(namespace string) (err error)
- func (w *K8sClient) WaitSAToken(namespace, serviceAccount string) (token string, err error)
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 ¶
NewK8sClientWithKubeConfig creates kubernetes client wrapper with the specified kubeconfig file
func NewK8sClientWithToken ¶
NewK8sClientWithKubeConfig creates kubernetes client wrapper with the token
func (*K8sClient) AssignRoleToSA ¶
func (*K8sClient) CreateNamespace ¶
CreateNamespace creates a new namespace
func (*K8sClient) DeleteNamespace ¶
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) (*workspacev1alpha2.WorkspacePhase, error)
get workspace current dev workspace status from the Custom Resource object
func (*K8sClient) GetPodNameBySelector ¶
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 ¶
Returns the list of currently scheduled or running pods in `namespace` with the given selector
func (*K8sClient) OcApplyWorkspace ¶
func (*K8sClient) WaitDevWsStatus ¶
func (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus workspacev1alpha2.WorkspacePhase) (bool, error)
func (*K8sClient) WaitForMutatingWebhooksConfigurations ¶
func (*K8sClient) WaitForPodRunningByLabel ¶
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 ¶
WaitNamespaceIsTerminated waits until namespace that is marked to be removed, is fully cleaned up