Documentation ¶
Index ¶
- Variables
- func AllRouteTrafficAtRevision(routeName string, revisionName string) func(r *v1alpha1.Route) (bool, error)
- func CleanupOnInterrupt(cleanup func())
- func Configuration(namespace string, config string, imagePath string) *v1alpha1.Configuration
- func IsRevisionReady(revisionName string) func(r *v1alpha1.Revision) (bool, error)
- func Route(namespace string, route string, config string) *v1alpha1.Route
- func WaitForConfigurationState(client elatyped.ConfigurationInterface, name string, ...) error
- func WaitForDeploymentState(client v1beta1.DeploymentInterface, name string, ...) error
- func WaitForEndpointState(kubeClientset *kubernetes.Clientset, resolvableDomain bool, domain string, ...) 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 elatyped.RevisionInterface, name string, ...) error
- func WaitForRouteState(client elatyped.RouteInterface, name string, ...) error
- type Clients
- type EnvironmentFlags
Constants ¶
This section is empty.
Variables ¶
var Flags = initializeFlags()
Flags will include the k8s cluster (defaults to $K8S_CLUSTER_OVERRIDE), kubeconfig (defaults to ./kube/config) (for connecting to an existing cluster), dockerRepo (defaults to $DOCKER_REPO_OVERRIDE) and how to connect to deployed endpoints.
Functions ¶
func AllRouteTrafficAtRevision ¶
func AllRouteTrafficAtRevision(routeName string, revisionName string) func(r *v1alpha1.Route) (bool, error)
AllRouteTrafficeAtRevision will check the revision that routeName is routing traffic to and return true if 100% of the traffic is routing to revisionName.
func CleanupOnInterrupt ¶
func CleanupOnInterrupt(cleanup func())
CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught
func Configuration ¶
func Configuration(namespace string, config string, imagePath string) *v1alpha1.Configuration
Configuration returns a Configuration object in namespace with the name config that uses the image specifed by imagePath.
func IsRevisionReady ¶
IsRevisionReady will check the status conditions of revision revisionName 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 Route ¶
Route returns a Route object in namespace with name route that will use the configuration resource called config.
func WaitForConfigurationState ¶
func WaitForConfigurationState(client elatyped.ConfigurationInterface, name string, inState func(c *v1alpha1.Configuration) (bool, error)) 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.
func WaitForDeploymentState ¶
func WaitForDeploymentState(client v1beta1.DeploymentInterface, name string, inState func(d *apiv1beta1.Deployment) (bool, error)) 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.
func WaitForEndpointState ¶
func WaitForEndpointState(kubeClientset *kubernetes.Clientset, resolvableDomain bool, domain string, namespaceName string, routeName string, inState func(body string) (bool, error)) 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 (named based on routeName) in the namespace namespaceName, and spoof domain in the request heaers, otherwise it will make the request directly to domain.
func WaitForIngressState ¶
func WaitForIngressState(client v1beta1.IngressInterface, name string, inState func(r *apiv1beta1.Ingress) (bool, error)) 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.
func WaitForPodListState ¶
func WaitForPodListState(client v1.PodInterface, inState func(p *corev1.PodList) (bool, error)) 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.
func WaitForRevisionState ¶
func WaitForRevisionState(client elatyped.RevisionInterface, name string, inState func(r *v1alpha1.Revision) (bool, error)) 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.
func WaitForRouteState ¶
func WaitForRouteState(client elatyped.RouteInterface, name string, inState func(r *v1alpha1.Route) (bool, error)) 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.
Types ¶
type Clients ¶
type Clients struct { Kube *kubernetes.Clientset Routes elatyped.RouteInterface Configs elatyped.ConfigurationInterface Revisions elatyped.RevisionInterface }
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.