{"modulePath":"github.com/devfile/devworkspace-operator","version":"v1.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Types\n\n```go\ntype K8sClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewK8sClientWithKubeConfig(kubeconfigFile string) (*K8sClient, error)\n```\nNewK8sClientWithKubeConfig creates kubernetes client wrapper with the specified kubeconfig file\n\n```go\nfunc NewK8sClientWithToken(baseKubeConfig, token string) (*K8sClient, error)\n```\nNewK8sClientWithKubeConfig creates kubernetes client wrapper with the token\n\n```go\nfunc (w *K8sClient) AssignRoleToSA(namespace, serviceAccount, role string) error\n```\n\n```go\nfunc (w *K8sClient) CheckK8sVersion() (string, error)\n```\n\n```go\nfunc (c *K8sClient) ControllerRuntimeClient() crclient.Client\n```\nControllerRuntimeClient returns the controller-runtime client for accessing custom resources.\n\n```go\nfunc (w *K8sClient) CreateNamespace(namespace string) error\n```\nCreateNamespace creates a new namespace\n\n```go\nfunc (w *K8sClient) CreateSA(name, namespace string) error\n```\n\n```go\nfunc (w *K8sClient) CreateSAToken(namespace string, serviceAccountName string) (string, error)\n```\n\n```go\nfunc (w *K8sClient) DeleteDevWorkspace(name, namespace string) error\n```\nDeleteDevWorkspace deletes a DevWorkspace using the Kubernetes client. Returns an error if the deletion fails (ignoring NotFound errors).\n\n```go\nfunc (w *K8sClient) DeleteDevWorkspaceAndWait(name, namespace string) error\n```\nDeleteDevWorkspaceAndWait deletes a workspace and waits for its PVC to be fully removed. This ensures proper cleanup and prevents PVC conflicts in subsequent tests.\n\n```go\nfunc (w *K8sClient) DeleteNamespace(namespace string) error\n```\nDeleteNamespace deletes a namespace\n\n```go\nfunc (w *K8sClient) ExecCommandInContainer(podName string, namespace, containerName, commandInContainer string) (output string, err error)\n```\nlaunch 'exec' oc command in the defined pod and container\n\n```go\nfunc (w *K8sClient) GetDevWsStatus(name, namespace string) (*dw.DevWorkspaceStatus, error)\n```\nget workspace current dev workspace status from the Custom Resource object\n\n```go\nfunc (w *K8sClient) GetLogsForContainer(podName string, namespace, containerName string) (output string, err error)\n```\n\n```go\nfunc (w *K8sClient) GetPodNameBySelector(selector, namespace string) (string, error)\n```\nGetPodNameBySelector returns the pod name that matches selector error is returned when\n\n```go\nfunc (w *K8sClient) IsPodContainerReady(containerName string, pod *v1.Pod) bool\n```\n\n```go\nfunc (c *K8sClient) Kube() kubernetes.Interface\n```\nKube returns the clientset for Kubernetes upstream.\n\n```go\nfunc (w *K8sClient) ListPods(namespace, selector string) (*v1.PodList, error)\n```\nReturns the list of currently scheduled or running pods in \\`namespace\\` with the given selector\n\n```go\nfunc (w *K8sClient) OcApplyWorkspace(namespace string, filePath string) (commandResult string, err error)\n```\n\n```go\nfunc (w *K8sClient) UpdateDevWorkspaceStarted(name, namespace string, started bool) error\n```\n\n```go\nfunc (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus dw.DevWorkspacePhase) (bool, error)\n```\n\n```go\nfunc (w *K8sClient) WaitForMutatingWebhooksConfigurations(name string) (deployed bool, err error)\n```\n\n```go\nfunc (w *K8sClient) WaitForPVCDeleted(pvcName, namespace string, timeout time.Duration) (bool, error)\n```\nWaitForPVCDeleted waits for a PVC to be fully deleted from the cluster. Returns true if deleted successfully, false if timeout occurred.\n\n```go\nfunc (w *K8sClient) WaitForPodContainerToReady(namespace, podName, containerName string) error\n```\n\n```go\nfunc (w *K8sClient) WaitForPodRunningByLabel(namespace, label string) (deployed bool, err error)\n```\n\n```go\nfunc (w *K8sClient) WaitForRunningPodBySelector(namespace, selector string, timeout time.Duration) error\n```\nWait 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.\n\n```go\nfunc (w *K8sClient) WaitNamespaceIsTerminated(namespace string) (err error)\n```\nWaitNamespaceIsTerminated waits until namespace that is marked to be removed, is fully cleaned up\n\n```go\nfunc (w *K8sClient) WaitSAToken(namespace, serviceAccount string) (token string, err error)\n```\nWaitSAToken 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\n\n","path":"github.com/devfile/devworkspace-operator/test/e2e/pkg/client","name":"client","synopsis":"","isRedistributable":true}
