Documentation ¶
Index ¶
- func CheckPodReady(pod *kubeApiCore.Pod) error
- type Accessor
- func (a *Accessor) Apply(namespace string, filename string) error
- func (a *Accessor) ApplyContents(namespace string, contents string) ([]string, error)
- func (a *Accessor) CreateNamespace(ns string, istioTestingAnnotation string, injectionEnabled bool) error
- func (a *Accessor) Delete(namespace string, filename string) error
- func (a *Accessor) DeleteContents(namespace string, contents string) error
- func (a *Accessor) DeleteCustomResourceDefinitions(name string) error
- func (a *Accessor) DeleteNamespace(ns string) error
- func (a *Accessor) DeletePod(namespace, name string) error
- func (a *Accessor) DeleteValidatingWebhook(name string) error
- func (a *Accessor) Exec(namespace, pod, container, command string) (string, error)
- func (a *Accessor) FindPodBySelectors(namespace string, selectors ...string) (kubeApiCore.Pod, error)
- func (a *Accessor) GetCustomResourceDefinitions() ([]kubeApiExt.CustomResourceDefinition, error)
- func (a *Accessor) GetEndpoints(ns, service string, options kubeApiMeta.GetOptions) (*kubeApiCore.Endpoints, error)
- func (a *Accessor) GetEvents(namespace string, involvedObject string) ([]kubeApiCore.Event, error)
- func (a *Accessor) GetPod(namespace, name string) (kubeApiCore.Pod, error)
- func (a *Accessor) GetPods(namespace string, selectors ...string) ([]kubeApiCore.Pod, error)
- func (a *Accessor) GetSecret(ns string) kubeClientCore.SecretInterface
- func (a *Accessor) GetService(ns string, name string) (*kubeApiCore.Service, error)
- func (a *Accessor) Logs(namespace string, pod string, container string) (string, error)
- func (a *Accessor) NamespaceExists(ns string) bool
- func (a *Accessor) NewPodFetch(namespace string, selectors ...string) PodFetchFunc
- func (a *Accessor) NewPortForwarder(pod kubeApiCore.Pod, localPort, remotePort uint16) (PortForwarder, error)
- func (a *Accessor) NewSinglePodFetch(namespace string, selectors ...string) PodFetchFunc
- func (a *Accessor) ValidatingWebhookConfigurationExists(name string) bool
- func (a *Accessor) WaitForNamespaceDeletion(ns string, opts ...retry.Option) error
- func (a *Accessor) WaitForValidatingWebhookDeletion(name string, opts ...retry.Option) error
- func (a *Accessor) WaitUntilDaemonSetIsReady(ns string, name string, opts ...retry.Option) error
- func (a *Accessor) WaitUntilDeploymentIsReady(ns string, name string, opts ...retry.Option) error
- func (a *Accessor) WaitUntilPodsAreDeleted(fetchFunc PodFetchFunc, opts ...retry.Option) error
- func (a *Accessor) WaitUntilPodsAreReady(fetchFunc PodFetchFunc, opts ...retry.Option) ([]kubeApiCore.Pod, error)
- func (a *Accessor) WaitUntilServiceEndpointsAreReady(ns string, name string, opts ...retry.Option) (*kubeApiCore.Service, error)
- type PodFetchFunc
- type PortForwarder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPodReady ¶
func CheckPodReady(pod *kubeApiCore.Pod) error
CheckPodReady returns nil if the given pod and all of its containers are ready.
Types ¶
type Accessor ¶
type Accessor struct {
// contains filtered or unexported fields
}
Accessor is a helper for accessing Kubernetes programmatically. It bundles some of the high-level operations that is frequently used by the test framework.
func NewAccessor ¶
NewAccessor returns a new instance of an accessor.
func (*Accessor) ApplyContents ¶
ApplyContents applies the given config contents using kubectl.
func (*Accessor) CreateNamespace ¶
func (a *Accessor) CreateNamespace(ns string, istioTestingAnnotation string, injectionEnabled bool) error
CreateNamespace with the given name. Also adds an "istio-testing" annotation.
func (*Accessor) DeleteContents ¶
DeleteContents deletes the given config contents using kubectl.
func (*Accessor) DeleteCustomResourceDefinitions ¶
DeleteCustomResourceDefinitions deletes the CRD with the given name.
func (*Accessor) DeleteNamespace ¶
DeleteNamespace with the given name
func (*Accessor) DeleteValidatingWebhook ¶
DeleteValidatingWebhook deletes the validating webhook with the given name.
func (*Accessor) FindPodBySelectors ¶
func (a *Accessor) FindPodBySelectors(namespace string, selectors ...string) (kubeApiCore.Pod, error)
FindPodBySelectors returns the first matching pod, given a namespace and a set of selectors.
func (*Accessor) GetCustomResourceDefinitions ¶
func (a *Accessor) GetCustomResourceDefinitions() ([]kubeApiExt.CustomResourceDefinition, error)
GetCustomResourceDefinitions gets the CRDs
func (*Accessor) GetEndpoints ¶
func (a *Accessor) GetEndpoints(ns, service string, options kubeApiMeta.GetOptions) (*kubeApiCore.Endpoints, error)
GetEndpoints returns the endpoints for the given service.
func (*Accessor) GetEvents ¶
GetEvents returns events in the given namespace, based on the involvedObject.
func (*Accessor) GetPod ¶
func (a *Accessor) GetPod(namespace, name string) (kubeApiCore.Pod, error)
GetPod returns the pod with the given namespace and name.
func (*Accessor) GetPods ¶
GetPods returns pods in the given namespace, based on the selectors. If no selectors are given, then all pods are returned.
func (*Accessor) GetSecret ¶
func (a *Accessor) GetSecret(ns string) kubeClientCore.SecretInterface
GetSecret returns secret resource with the given namespace.
func (*Accessor) GetService ¶
GetService returns the service entry with the given name/namespace.
func (*Accessor) Logs ¶
Logs calls the logs command for the specified pod, with -c, if container is specified.
func (*Accessor) NamespaceExists ¶
NamespaceExists returns true if the given namespace exists.
func (*Accessor) NewPodFetch ¶
func (a *Accessor) NewPodFetch(namespace string, selectors ...string) PodFetchFunc
NewPodFetch creates a new PodFetchFunction that fetches all pods matching the namespace and label selectors.
func (*Accessor) NewPortForwarder ¶
func (a *Accessor) NewPortForwarder(pod kubeApiCore.Pod, localPort, remotePort uint16) (PortForwarder, error)
NewPortForwarder creates a new port forwarder.
func (*Accessor) NewSinglePodFetch ¶
func (a *Accessor) NewSinglePodFetch(namespace string, selectors ...string) PodFetchFunc
NewSinglePodFetch creates a new PodFetchFunction that fetches a single pod matching the given label selectors.
func (*Accessor) ValidatingWebhookConfigurationExists ¶
ValidatingWebhookConfigurationExists indicates whether a mutating validating with the given name exists.
func (*Accessor) WaitForNamespaceDeletion ¶
WaitForNamespaceDeletion waits until a namespace is deleted.
func (*Accessor) WaitForValidatingWebhookDeletion ¶
WaitForValidatingWebhookDeletion waits for the validating webhook with the given name to be garbage collected by kubernetes.
func (*Accessor) WaitUntilDaemonSetIsReady ¶
WaitUntilDaemonSetIsReady waits until the deployment with the name/namespace is in ready state.
func (*Accessor) WaitUntilDeploymentIsReady ¶
WaitUntilDeploymentIsReady waits until the deployment with the name/namespace is in ready state.
func (*Accessor) WaitUntilPodsAreDeleted ¶
func (a *Accessor) WaitUntilPodsAreDeleted(fetchFunc PodFetchFunc, opts ...retry.Option) error
WaitUntilPodsAreDeleted waits until the pod with the name/namespace no longer exist.
func (*Accessor) WaitUntilPodsAreReady ¶
func (a *Accessor) WaitUntilPodsAreReady(fetchFunc PodFetchFunc, opts ...retry.Option) ([]kubeApiCore.Pod, error)
WaitUntilPodsAreReady waits until the pod with the name/namespace is in ready state.
func (*Accessor) WaitUntilServiceEndpointsAreReady ¶
func (a *Accessor) WaitUntilServiceEndpointsAreReady(ns string, name string, opts ...retry.Option) (*kubeApiCore.Service, error)
WaitUntilServiceEndpointsAreReady will wait until the service with the given name/namespace is present, and have at least one usable endpoint.
type PodFetchFunc ¶
type PodFetchFunc func() ([]kubeApiCore.Pod, error)
PodFetchFunc fetches pods from the Accessor.