Documentation ¶
Index ¶
- Variables
- func BuildClientConfig(kubeConfigPath string, clusterName string) (*rest.Config, error)
- func CleanupOnInterrupt(cleanup func(), logger *logging.BaseLogger)
- func DeploymentScaledToZeroFunc() func(d *apiv1beta1.Deployment) (bool, error)
- func EventuallyMatchesBody(expected string) spoof.ResponseChecker
- func GetConfigMap(client *KubeClient) k8styped.ConfigMapInterface
- func MatchesAny(_ *spoof.Response) (bool, error)
- func MatchesBody(expected string) spoof.ResponseChecker
- func NewSpoofingClient(client *KubeClient, logger *logging.BaseLogger, domain string, resolvable bool) (*spoof.SpoofingClient, error)
- func Retrying(rc spoof.ResponseChecker, codes ...int) spoof.ResponseChecker
- func WaitForDeploymentState(client *KubeClient, name string, ...) error
- func WaitForEndpointState(kubeClient *KubeClient, logger *logging.BaseLogger, domain string, ...) (*spoof.Response, error)
- func WaitForPodListState(client *KubeClient, inState func(p *corev1.PodList) (bool, error), desc string, ...) error
- type EnvironmentFlags
- type KubeClient
Constants ¶
This section is empty.
Variables ¶
var Flags = initializeFlags()
Flags holds the command line flags or defaults for settings in the user's environment. See EnvironmentFlags for a list of supported fields.
Functions ¶
func BuildClientConfig ¶
BuildClientConfig builds the client config specified by the config path and the cluster name
func CleanupOnInterrupt ¶
func CleanupOnInterrupt(cleanup func(), logger *logging.BaseLogger)
CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught
func DeploymentScaledToZeroFunc ¶
func DeploymentScaledToZeroFunc() func(d *apiv1beta1.Deployment) (bool, error)
Returns a func that evaluates if a deployment has scaled to 0 pods
func EventuallyMatchesBody ¶
func EventuallyMatchesBody(expected string) spoof.ResponseChecker
EventuallyMatchesBody checks that the response body *eventually* matches the expected body. TODO(#1178): Delete me. We don't want to need this; we should be waiting for an appropriate Status instead.
func GetConfigMap ¶
func GetConfigMap(client *KubeClient) k8styped.ConfigMapInterface
GetConfigMap gets the knative serving config map.
func MatchesAny ¶
MatchesAny is a NOP matcher. This is useful for polling until a 200 is returned.
func MatchesBody ¶
func MatchesBody(expected string) spoof.ResponseChecker
MatchesBody checks that the *first* response body matches the "expected" body, otherwise failing.
func NewSpoofingClient ¶
func NewSpoofingClient(client *KubeClient, logger *logging.BaseLogger, domain string, resolvable bool) (*spoof.SpoofingClient, error)
NewSpoofingClient returns a spoofing client to make requests
func Retrying ¶
func Retrying(rc spoof.ResponseChecker, codes ...int) spoof.ResponseChecker
Retrying modifies a ResponseChecker to retry certain response codes.
func WaitForDeploymentState ¶
func WaitForDeploymentState(client *KubeClient, name string, inState func(d *apiv1beta1.Deployment) (bool, error), desc string, namespace string, timeout time.Duration) error
WaitForDeploymentState polls the status of the Deployment called name from client every interval until inState returns `true` indicating it is done, returns an error or timeout. desc will be used to name the metric that is emitted to track how long it took for name to get into the state checked by inState.
func WaitForEndpointState ¶
func WaitForEndpointState(kubeClient *KubeClient, logger *logging.BaseLogger, domain string, inState spoof.ResponseChecker, desc string, resolvable bool) (*spoof.Response, error)
WaitForEndpointState will poll an endpoint until inState indicates the state is achieved. If resolvableDomain is false, it will use kubeClientset to look up the ingress and spoof the domain in the request headers, otherwise it will make the request directly to domain. desc will be used to name the metric that is emitted to track how long it took for the domain to get into the state checked by inState. Commas in `desc` must be escaped.
func WaitForPodListState ¶
func WaitForPodListState(client *KubeClient, inState func(p *corev1.PodList) (bool, error), desc string, namespace string) error
WaitForPodListState polls the status of the PodList from client every interval until inState returns `true` indicating it is done, returns an error or timeout. desc will be used to name the metric that is emitted to track how long it took to get into the state checked by inState.
Types ¶
type EnvironmentFlags ¶
type EnvironmentFlags struct { Cluster string // K8s cluster (defaults to $K8S_CLUSTER_OVERRIDE) Kubeconfig string // Path to kubeconfig (defaults to ./kube/config) Namespace string // K8s namespace (blank by default, to be overwritten by test suite) LogVerbose bool // Enable verbose logging EmitMetrics bool // Emit metrics }
EnvironmentFlags define the flags that are needed to run the e2e tests.
type KubeClient ¶
type KubeClient struct {
Kube *kubernetes.Clientset
}
KubeClient holds instances of interfaces for making requests to kubernetes client.
func NewKubeClient ¶
func NewKubeClient(configPath string, clusterName string) (*KubeClient, error)
NewKubeClient instantiates and returns several clientsets required for making request to the kube client specified by the combination of clusterName and configPath. Clients can make requests within namespace.
func (*KubeClient) UpdateConfigMap ¶
func (client *KubeClient) UpdateConfigMap(name string, configName string, values map[string]string) error
UpdateConfigMap updates the config map for specified @name with values