import "istio.io/istio/pkg/test/kube"
dump.go mock_client.go util.go
func CheckPodsAreReady(fetchFunc PodFetchFunc) ([]kubeApiCore.Pod, error)
CheckPodsAreReady checks whether the pods that are selected by the given function is in ready state or not.
func DeleteOptionsForeground() kubeApiMeta.DeleteOptions
DeleteOptionsForeground creates new delete options that will block until the operation completes.
func DumpNdsz(_ resource.Context, c resource.Cluster, workDir string, _ string, pods ...corev1.Pod)
func DumpPodEvents(_ resource.Context, c resource.Cluster, workDir, namespace string, pods ...corev1.Pod)
DumpPodEvents dumps the pod events for either the provided pods or all pods in the namespace if none are provided.
func DumpPodLogs(_ resource.Context, c resource.Cluster, workDir, namespace string, pods ...corev1.Pod)
DumpPodLogs will dump logs from each container in each of the provided pods or all pods in the namespace if none are provided.
func DumpPodProxies(_ resource.Context, c resource.Cluster, workDir, namespace string, pods ...corev1.Pod)
DumpPodProxies will dump Envoy proxy config and clusters in each of the provided pods or all pods in the namespace if none are provided.
func DumpPodState(_ resource.Context, c resource.Cluster, workDir string, namespace string, pods ...corev1.Pod)
DumpPodState dumps the pod state for either the provided pods or all pods in the namespace if none are provided.
DumpPods runs each dumper with all the pods in the given namespace. If no dumpers are provided, their resource state, events, container logs and Envoy information will be dumped.
func NamespaceExists(a kubernetes.Interface, ns string) bool
NamespaceExists returns true if the given namespace exists.
WaitForNamespaceDeletion waits until a namespace is deleted.
func WaitForSecretToExist(a kubernetes.Interface, namespace, name string, waitTime time.Duration) (*kubeApiCore.Secret, error)
WaitForSecretToExist waits for the given secret up to the given waitTime.
func WaitForSecretToExistOrFail(t test.Failer, a kubernetes.Interface, namespace, name string, waitTime time.Duration) *kubeApiCore.Secret
WaitForSecretToExistOrFail calls WaitForSecretToExist and fails the given test.Failer if an error occurs.
func WaitUntilPodsAreReady(fetchFunc PodFetchFunc, opts ...retry.Option) ([]kubeApiCore.Pod, error)
WaitUntilPodsAreReady waits until the pod with the name/namespace is in ready state.
func WaitUntilServiceEndpointsAreReady(a kubernetes.Interface, ns string, name string, opts ...retry.Option) (*kubeApiCore.Service, *kubeApiCore.Endpoints, error)
WaitUntilServiceEndpointsAreReady will wait until the service with the given name/namespace is present, and have at least one usable endpoint.
type MockClient struct { kubernetes.Interface RestClient *rest.RESTClient // Results is a map of podName to the results of the expected test on the pod Results map[string][]byte DiscoverablePods map[string]map[string]*v1.PodList RevisionValue string ConfigValue *rest.Config IstioVersions *version.MeshInfo }
MockClient for tests that rely on kube.Client.
func (c MockClient) ApplyYAMLFiles(string, ...string) error
func (c MockClient) ApplyYAMLFilesDryRun(string, ...string) error
func (c MockClient) CreatePerRPCCredentials(ctx context.Context, tokenNamespace, tokenServiceAccount string, audiences []string, expirationSeconds int64) (credentials.PerRPCCredentials, error)
CreatePerRPCCredentials -- when implemented -- mocks per-RPC credentials (bearer token)
func (c MockClient) DeleteYAMLFiles(string, ...string) error
func (c MockClient) DeleteYAMLFilesDryRun(string, ...string) error
func (c MockClient) Dynamic() dynamic.Interface
func (c MockClient) DynamicClient() dynamic.Interface
func (c MockClient) DynamicInformer() dynamicinformer.DynamicSharedInformerFactory
func (c MockClient) Ext() clientset.Interface
func (c MockClient) GetIstioPods(_ context.Context, _ string, _ map[string]string) ([]v1.Pod, error)
func (c MockClient) GetKubernetesVersion() (*kubeVersion.Info, error)
func (c MockClient) Istio() istioclient.Interface
func (c MockClient) IstioInformer() istioinformer.SharedInformerFactory
func (c MockClient) Kube() kubernetes.Interface
func (c MockClient) KubeInformer() informers.SharedInformerFactory
func (c MockClient) Metadata() metadata.Interface
func (c MockClient) MetadataClient() metadata.Interface
func (c MockClient) MetadataInformer() metadatainformer.SharedInformerFactory
func (c MockClient) NewPortForwarder(_, _, _ string, _, _ int) (kube.PortForwarder, error)
func (c MockClient) PodLogs(_ context.Context, _ string, _ string, _ string, _ bool) (string, error)
func (c MockClient) PodsForSelector(_ context.Context, namespace string, labelSelectors ...string) (*v1.PodList, error)
func (c MockClient) REST() rest.Interface
func (c MockClient) RESTConfig() *rest.Config
func (c MockClient) Revision() string
func (c MockClient) RunAndWait(stop <-chan struct{})
func (c MockClient) ServiceApis() serviceapisclient.Interface
func (c MockClient) ServiceApisInformer() serviceapisinformer.SharedInformerFactory
func (c MockClient) UtilFactory() util.Factory
UtilFactory mock's kubectl's utility factory. This code sets up a fake factory, similar to the one in https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/describe/describe_test.go
type MockPortForwarder struct { }
func (m MockPortForwarder) Address() string
func (m MockPortForwarder) Close()
func (m MockPortForwarder) Start() error
func (m MockPortForwarder) WaitForStop()
type PodDumper func(ctx resource.Context, cluster resource.Cluster, workDir string, namespace string, pods ...corev1.Pod)
PodDumper will dump information from all the pods into the given workDir. If no pods are provided, client will be used to fetch all the pods in a namespace.
type PodFetchFunc func() ([]kubeApiCore.Pod, error)
PodFetchFunc fetches pods from a k8s Client.
func NewPodFetch(a istioKube.ExtendedClient, namespace string, selectors ...string) PodFetchFunc
NewPodFetch creates a new PodFetchFunction that fetches all pods matching the namespace and label selectors.
func NewPodMustFetch(a istioKube.ExtendedClient, namespace string, selectors ...string) PodFetchFunc
NewPodMustFetch creates a new PodFetchFunction that fetches all pods matching the namespace and label selectors. If no pods are found, an error is returned
func NewSinglePodFetch(a istioKube.ExtendedClient, namespace string, selectors ...string) PodFetchFunc
NewSinglePodFetch creates a new PodFetchFunction that fetches a single pod matching the given label selectors.
Package kube imports 38 packages (graph) and is imported by 17 packages. Updated 2021-01-22. Refresh now. Tools for package owners.