Documentation
¶
Index ¶
- Constants
- Variables
- func AllRouteTrafficAtRevision(names ResourceNames) func(r *v1alpha1.Route) (bool, error)
- func AppendRandomString(prefix string, logger *zap.SugaredLogger) string
- func BlueGreenRoute(namespace string, names, blue, green ResourceNames) *v1alpha1.Route
- func CheckConfigurationState(client servingtyped.ConfigurationInterface, name string, ...) error
- func CheckRevisionState(client servingtyped.RevisionInterface, name string, ...) error
- func CheckRouteState(client servingtyped.RouteInterface, name string, ...) error
- func CheckServiceState(client servingtyped.ServiceInterface, name string, ...) error
- func CleanupOnInterrupt(cleanup func(), logger *zap.SugaredLogger)
- func Configuration(namespace string, names ResourceNames, imagePath string) *v1alpha1.Configuration
- func ConfigurationHasCreatedRevision(c *v1alpha1.Configuration) (bool, error)
- func ConfigurationWithBuild(namespace string, names ResourceNames, build *buildv1alpha1.BuildSpec, ...) *v1alpha1.Configuration
- func CreateConfiguration(clients *Clients, names ResourceNames, imagePath string) error
- func CreateRoute(clients *Clients, names ResourceNames) error
- func EventuallyMatchesBody(expected string) spoof.ResponseChecker
- func GetContextLogger(context string) *zap.SugaredLogger
- func IsConfigRevisionCreationFailed(c *v1alpha1.Configuration) (bool, error)
- func IsRevisionAtExpectedGeneration(expectedGeneration string) func(r *v1alpha1.Revision) (bool, error)
- func IsRevisionBuildFailed(r *v1alpha1.Revision) (bool, error)
- func IsRevisionReady(r *v1alpha1.Revision) (bool, error)
- func IsRouteReady(r *v1alpha1.Route) (bool, error)
- func IsServiceReady(s *v1alpha1.Service) (bool, error)
- func LatestService(namespace string, names ResourceNames, imagePath string) *v1alpha1.Service
- func MatchesAny(_ *spoof.Response) (bool, error)
- func MatchesBody(expected string) spoof.ResponseChecker
- func Route(namespace string, names ResourceNames) *v1alpha1.Route
- func TODO_RouteTrafficToRevisionWithInClusterDNS(r *v1alpha1.Route) (bool, error)
- func TODO_ServiceTrafficToRevisionWithInClusterDNS(s *v1alpha1.Service) (bool, error)
- func WaitForConfigurationState(client servingtyped.ConfigurationInterface, name string, ...) error
- func WaitForDeploymentState(client v1beta1.DeploymentInterface, name string, ...) error
- func WaitForEndpointState(kubeClientset *kubernetes.Clientset, logger *zap.SugaredLogger, ...) error
- func WaitForIngressState(client v1beta1.IngressInterface, name string, ...) error
- func WaitForPodListState(client v1.PodInterface, inState func(p *corev1.PodList) (bool, error), ...) error
- func WaitForRevisionState(client servingtyped.RevisionInterface, name string, ...) error
- func WaitForRouteState(client servingtyped.RouteInterface, name string, ...) error
- func WaitForServiceState(client servingtyped.ServiceInterface, name string, ...) error
- type Clients
- type EnvironmentFlags
- type ResourceNames
Constants ¶
const ( // VerboseLogLevel defines verbose log level as 10 VerboseLogLevel glog.Level = 10 )
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 AllRouteTrafficAtRevision ¶
func AllRouteTrafficAtRevision(names ResourceNames) func(r *v1alpha1.Route) (bool, error)
AllRouteTrafficAtRevision will check the revision that route r is routing traffic to and return true if 100% of the traffic is routing to revisionName.
func AppendRandomString ¶
func AppendRandomString(prefix string, logger *zap.SugaredLogger) string
AppendRandomString will generate a random string that begins with prefix. This is useful if you want to make sure that your tests can run at the same time against the same environment without conflicting. This method will seed rand with the current time when called for the first time.
func BlueGreenRoute ¶
func BlueGreenRoute(namespace string, names, blue, green ResourceNames) *v1alpha1.Route
BlueGreenRoute returns a Route object in namespace using the route and configuration names in names. Traffic is split evenly between blue and green.
func CheckConfigurationState ¶
func CheckConfigurationState(client servingtyped.ConfigurationInterface, name string, inState func(r *v1alpha1.Configuration) (bool, error)) error
CheckConfigurationState verifies the status of the Configuration called name from client is in a particular state by calling `inState` and expecting `true`. This is the non-polling variety of WaitForConfigurationState
func CheckRevisionState ¶
func CheckRevisionState(client servingtyped.RevisionInterface, name string, inState func(r *v1alpha1.Revision) (bool, error)) error
CheckRevisionState verifies the status of the Revision called name from client is in a particular state by calling `inState` and expecting `true`. This is the non-polling variety of WaitForRevisionState
func CheckRouteState ¶
func CheckRouteState(client servingtyped.RouteInterface, name string, inState func(r *v1alpha1.Route) (bool, error)) error
CheckRouteState verifies the status of the Route called name from client is in a particular state by calling `inState` and expecting `true`. This is the non-polling variety of WaitForRouteState
func CheckServiceState ¶
func CheckServiceState(client servingtyped.ServiceInterface, name string, inState func(s *v1alpha1.Service) (bool, error)) error
CheckServiceState verifies the status of the Service called name from client is in a particular state by calling `inState` and expecting `true`. This is the non-polling variety of WaitForServiceState
func CleanupOnInterrupt ¶
func CleanupOnInterrupt(cleanup func(), logger *zap.SugaredLogger)
CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught
func Configuration ¶
func Configuration(namespace string, names ResourceNames, imagePath string) *v1alpha1.Configuration
Configuration returns a Configuration object in namespace with the name names.Config that uses the image specifed by imagePath.
func ConfigurationHasCreatedRevision ¶
func ConfigurationHasCreatedRevision(c *v1alpha1.Configuration) (bool, error)
ConfigurationHasCreatedRevision returns whether the Configuration has created a Revision.
func ConfigurationWithBuild ¶
func ConfigurationWithBuild(namespace string, names ResourceNames, build *buildv1alpha1.BuildSpec, imagePath string) *v1alpha1.Configuration
func CreateConfiguration ¶
func CreateConfiguration(clients *Clients, names ResourceNames, imagePath string) error
CreateConfiguration create a configuration resource in namespace with the name names.Config that uses the image specifed by imagePath.
func CreateRoute ¶
func CreateRoute(clients *Clients, names ResourceNames) error
CreateRoute creates a route in the given namespace using the route name in names
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 GetContextLogger ¶
func GetContextLogger(context string) *zap.SugaredLogger
GetContextLogger creates a Named logger (https://godoc.org/go.uber.org/zap#Logger.Named) using the provided context as a name. This will also register the logger as a metric exporter, which is unfortunately global, so calling `GetContextLogger` will have the side effect of changing the context in which all metrics are logged from that point forward.
func IsConfigRevisionCreationFailed ¶
func IsConfigRevisionCreationFailed(c *v1alpha1.Configuration) (bool, error)
IsConfigRevisionCreationFailed will check the status conditions of the configuration and return true if the configuration's revision failed to create.
func IsRevisionAtExpectedGeneration ¶
func IsRevisionAtExpectedGeneration(expectedGeneration string) func(r *v1alpha1.Revision) (bool, error)
IsRevisionAtExpectedGeneration returns a function that will check if the annotations on the revision include an annotation for the generation and that the annotation is set to the expected value.
func IsRevisionBuildFailed ¶
IsRevisionBuildFailed will check the status conditions of the revision and return true if the revision's build failed.
func IsRevisionReady ¶
IsRevisionReady will check the status conditions of the revision and return true if the revision is ready to serve traffic. It will return false if the status indicates a state other than deploying or being ready. It will also return false if the type of the condition is unexpected.
func IsRouteReady ¶
IsRouteReady will check the status conditions of the route and return true if the route is ready.
func IsServiceReady ¶
IsServiceReady will check the status conditions of the service and return true if the service is ready. This means that its configurations and routes have all reported ready.
func LatestService ¶
func LatestService(namespace string, names ResourceNames, imagePath string) *v1alpha1.Service
LatestService returns a RunLatest Service object in namespace with the name names.Service that uses the image specifed by imagePath.
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 Route ¶
func Route(namespace string, names ResourceNames) *v1alpha1.Route
Route returns a Route object in namespace using the route and configuration names in names.
func TODO_RouteTrafficToRevisionWithInClusterDNS ¶
RouteTrafficToRevisionWithInClusterDNS will check the revision that route r is routing traffic using in cluster DNS and return true if the revision received the request.
func TODO_ServiceTrafficToRevisionWithInClusterDNS ¶
ServiceTrafficToRevisionWithInClusterDNS will check the revision that route r is routing traffic using in cluster DNS and return true if the revision received the request.
func WaitForConfigurationState ¶
func WaitForConfigurationState(client servingtyped.ConfigurationInterface, name string, inState func(c *v1alpha1.Configuration) (bool, error), desc string) error
WaitForConfigurationState polls the status of the Configuration 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 WaitForDeploymentState ¶
func WaitForDeploymentState(client v1beta1.DeploymentInterface, name string, inState func(d *apiv1beta1.Deployment) (bool, error), desc string) 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(kubeClientset *kubernetes.Clientset, logger *zap.SugaredLogger, resolvableDomain bool, domain string, inState spoof.ResponseChecker, desc string) 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 WaitForIngressState ¶
func WaitForIngressState(client v1beta1.IngressInterface, name string, inState func(r *apiv1beta1.Ingress) (bool, error), desc string) error
WaitForIngressState polls the status of the Ingress 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 WaitForPodListState ¶
func WaitForPodListState(client v1.PodInterface, inState func(p *corev1.PodList) (bool, error), desc 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.
func WaitForRevisionState ¶
func WaitForRevisionState(client servingtyped.RevisionInterface, name string, inState func(r *v1alpha1.Revision) (bool, error), desc string) error
WaitForRevisionState polls the status of the Revision 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 WaitForRouteState ¶
func WaitForRouteState(client servingtyped.RouteInterface, name string, inState func(r *v1alpha1.Route) (bool, error), desc string) error
WaitForRouteState polls the status of the Route 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 WaitForServiceState ¶
func WaitForServiceState(client servingtyped.ServiceInterface, name string, inState func(s *v1alpha1.Service) (bool, error), desc string) error
WaitForServiceState polls the status of the Service 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.
Types ¶
type Clients ¶
type Clients struct {
Kube *kubernetes.Clientset
Routes servingtyped.RouteInterface
Configs servingtyped.ConfigurationInterface
Revisions servingtyped.RevisionInterface
Services servingtyped.ServiceInterface
Builds buildtyped.BuildInterface
}
Clients holds instances of interfaces for making requests to Knative Serving.
func NewClients ¶
NewClients instantiates and returns several clientsets required for making request to the Knative Serving cluster specified by the combination of clusterName and configPath. Clients can make requests within namespace.
type EnvironmentFlags ¶
type EnvironmentFlags struct {
Cluster string // K8s cluster (defaults to $K8S_CLUSTER_OVERRIDE)
DockerRepo string // Docker repo (defaults to $DOCKER_REPO_OVERRIDE)
Kubeconfig string // Path to kubeconfig (defaults to ./kube/config)
Namespace string // K8s namespace (blank by default, to be overwritten by test suite)
ResolvableDomain bool // Resolve Route controller's `domainSuffix`
LogVerbose bool // Enable verbose logging
EmitMetrics bool // Emit metrics
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
conformance
|
|
|
test_images/pizzaplanetv1
command
|
|
|
test_images/pizzaplanetv2
command
|
|
|
test_images/autoscale
command
|
|
|
test_images/helloworld
command
|
|