Documentation ¶
Index ¶
- type K8sClient
- func (w *K8sClient) ApplyResource(filePath string) (err error)
- func (w *K8sClient) CurlEndpointInContainer(pod string, container string, endpoint string) (string, error)
- func (w *K8sClient) DeleteResource(filePath string) (err error)
- func (w *K8sClient) GetRegistryInstance(name string) (*registryv1alpha1.DevfileRegistry, error)
- func (c *K8sClient) Kube() kubernetes.Interface
- func (w *K8sClient) ListPods(namespace, selector string) (*v1.PodList, error)
- func (w *K8sClient) WaitForFailedPodBySelector(namespace, selector string, timeout time.Duration) error
- func (w *K8sClient) WaitForPodFailedByLabel(label string) (deployed bool, err error)
- func (w *K8sClient) WaitForPodFailedByLabelWithNamespace(label string, namespace string) (deployed bool, err error)
- func (w *K8sClient) WaitForPodRunningByLabel(label string) (deployed bool, err error)
- func (w *K8sClient) WaitForPodRunningByLabelWithNamespace(label string, namespace string) (deployed bool, err error)
- func (w *K8sClient) WaitForRegistryInstance(name string, timeout time.Duration) error
- func (w *K8sClient) WaitForRunningPodBySelector(namespace, selector string, timeout time.Duration) error
- func (w *K8sClient) WaitForURLChange(name string, oldURL string, timeout time.Duration) (string, 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 NewK8sClient ¶
NewK8sClient creates kubernetes client wrapper with helper functions and direct access to k8s go client
func (*K8sClient) ApplyResource ¶ added in v0.2.0
ApplyResource applies resources on the cluster, corresponding to the specified file(s)
func (*K8sClient) CurlEndpointInContainer ¶
func (w *K8sClient) CurlEndpointInContainer(pod string, container string, endpoint string) (string, error)
CurlEndpointInContainer execs into the given container in the pod and uses curl to hit the specified endpoint
func (*K8sClient) DeleteResource ¶ added in v0.2.0
DeleteResource deletes the resources from the cluster that the specified file(s) correspond to
func (*K8sClient) GetRegistryInstance ¶
func (w *K8sClient) GetRegistryInstance(name string) (*registryv1alpha1.DevfileRegistry, error)
GetRegistryInstance uses the Kubernetes REST API to retrieve the specified instance of the DevfileRegistry custom resource If there are any issues retrieving the resource or unmarshalling it, an error is returned
func (*K8sClient) Kube ¶
func (c *K8sClient) Kube() kubernetes.Interface
Kube returns the clientset for Kubernetes upstream.
func (*K8sClient) ListPods ¶
ListPods returns the list of currently scheduled or running pods in `namespace` with the given selector
func (*K8sClient) WaitForFailedPodBySelector ¶ added in v0.1.1
func (w *K8sClient) WaitForFailedPodBySelector(namespace, selector string, timeout time.Duration) error
WaitForFailedPodBySelector waits 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) WaitForPodFailedByLabel ¶ added in v0.1.1
WaitForPodFailedByLabel waits for the pod matching the specified label to become running An error is returned if the pod does not exist or the timeout is reached
func (*K8sClient) WaitForPodFailedByLabelWithNamespace ¶ added in v0.1.1
func (w *K8sClient) WaitForPodFailedByLabelWithNamespace(label string, namespace string) (deployed bool, err error)
WaitForPodFailedByLabelWithNamespace waits for the pod matching the specified label in a specified namespace to become running An error is returned if the pod does not exist or the timeout is reached
func (*K8sClient) WaitForPodRunningByLabel ¶
WaitForPodRunningByLabel waits for the pod matching the specified label to become running An error is returned if the pod does not exist or the timeout is reached
func (*K8sClient) WaitForPodRunningByLabelWithNamespace ¶
func (w *K8sClient) WaitForPodRunningByLabelWithNamespace(label string, namespace string) (deployed bool, err error)
WaitForPodRunningByLabelWithNamespace waits for the pod matching the specified label in a specified namespace to become running An error is returned if the pod does not exist or the timeout is reached
func (*K8sClient) WaitForRegistryInstance ¶
WaitForRegistryInstance polls up to timeout seconds for the registry's server to become active (URL set in the status)
func (*K8sClient) WaitForRunningPodBySelector ¶
func (w *K8sClient) WaitForRunningPodBySelector(namespace, selector string, timeout time.Duration) error
WaitForRunningPodBySelector waits 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) WaitForURLChange ¶
func (w *K8sClient) WaitForURLChange(name string, oldURL string, timeout time.Duration) (string, error)
WaitForURLChange polls up to timeout seconds for the registry's URL to change in the status and returns it. If the URL doesn't change in the specified timeout, an error is returned