Documentation ¶
Index ¶
- func AllRouteTrafficAtRevision(names test.ResourceNames) func(r *v1.Route) (bool, error)
- func CheckConfigurationState(client *test.ServingClients, name string, ...) error
- func CheckRevisionState(client *test.ServingClients, name string, ...) error
- func CheckRouteState(client *test.ServingClients, name string, ...) error
- func CheckServiceState(client *test.ServingClients, name string, ...) error
- func Configuration(names test.ResourceNames, fopt ...rtesting.ConfigOption) *v1.Configuration
- func ConfigurationSpec(imagePath string) *v1.ConfigurationSpec
- func CreateConfiguration(t testing.TB, clients *test.Clients, names test.ResourceNames, ...) (cfg *v1.Configuration, err error)
- func CreateRoute(t testing.TB, clients *test.Clients, names test.ResourceNames, ...) (rt *v1.Route, err error)
- func CreateService(t testing.TB, clients *test.Clients, names test.ResourceNames, ...) (*v1.Service, error)
- func DeleteService(clients *test.Clients, serviceName string) (err error)
- func GetConfigurations(clients *test.Clients) (list *v1.ConfigurationList, err error)
- func GetRevision(clients *test.Clients, revisionName string) (revision *v1.Revision, err error)
- func GetRevisions(clients *test.Clients) (list *v1.RevisionList, err error)
- func GetRoute(clients *test.Clients, routeName string) (route *v1.Route, err error)
- func GetRoutes(clients *test.Clients) (list *v1.RouteList, err error)
- func GetServices(clients *test.Clients) (list *v1.ServiceList, err error)
- func IsConfigurationReady(c *v1.Configuration) (bool, error)
- func IsRevisionAtExpectedGeneration(expectedGeneration string) func(r *v1.Revision) (bool, error)
- func IsRevisionReady(r *v1.Revision) (bool, error)
- func IsRevisionRoutingActive(r *v1.Revision) (bool, error)
- func IsRouteFailed(r *v1.Route) (bool, error)
- func IsRouteReady(r *v1.Route) (bool, error)
- func IsServiceAndChildrenFailed(s *v1.Service) (bool, error)
- func IsServiceFailed(s *v1.Service) (bool, error)
- func IsServiceReady(s *v1.Service) (bool, error)
- func IsServiceRoutesNotReady(s *v1.Service) (bool, error)
- func LogResourceObject(t testing.TB, value ResourceObjects)
- func PatchConfig(t testing.TB, clients *test.Clients, config *v1.Configuration, ...) (cfg *v1.Configuration, err error)
- func PatchService(t testing.TB, clients *test.Clients, service *v1.Service, ...) (svc *v1.Service, err error)
- func PatchServiceRouteSpec(t testing.TB, clients *test.Clients, names test.ResourceNames, rs v1.RouteSpec) (svc *v1.Service, err error)
- func Route(names test.ResourceNames, fopt ...rtesting.RouteOption) *v1.Route
- func Service(names test.ResourceNames, fopt ...rtesting.ServiceOption) *v1.Service
- func UpdateService(t testing.TB, clients *test.Clients, names test.ResourceNames, ...) (svc *v1.Service, err error)
- func WaitForConfigLatestPinnedRevision(clients *test.Clients, names test.ResourceNames) (string, error)
- func WaitForConfigLatestRevision(clients *test.Clients, names test.ResourceNames, ensurePinned bool) (string, error)
- func WaitForConfigLatestUnpinnedRevision(clients *test.Clients, names test.ResourceNames) (string, error)
- func WaitForConfigurationState(client *test.ServingClients, name string, ...) error
- func WaitForRevisionState(client *test.ServingClients, name string, ...) error
- func WaitForRouteState(client *test.ServingClients, name string, ...) error
- func WaitForServiceLatestRevision(clients *test.Clients, names test.ResourceNames) (string, error)
- func WaitForServiceState(client *test.ServingClients, name string, ...) error
- type ResourceObjects
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllRouteTrafficAtRevision ¶
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 CheckConfigurationState ¶
func CheckConfigurationState(client *test.ServingClients, name string, inState func(r *v1.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 *test.ServingClients, name string, inState func(r *v1.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 *test.ServingClients, name string, inState func(r *v1.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 *test.ServingClients, name string, inState func(s *v1.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 Configuration ¶
func Configuration(names test.ResourceNames, fopt ...rtesting.ConfigOption) *v1.Configuration
Configuration returns a Configuration object in namespace with the name names.Config that uses the image specified by names.Image
func ConfigurationSpec ¶
func ConfigurationSpec(imagePath string) *v1.ConfigurationSpec
ConfigurationSpec returns the spec of a configuration to be used throughout different CRD helpers.
func CreateConfiguration ¶
func CreateConfiguration(t testing.TB, clients *test.Clients, names test.ResourceNames, fopt ...rtesting.ConfigOption) (cfg *v1.Configuration, err error)
CreateConfiguration create a configuration resource in namespace with the name names.Config that uses the image specified by names.Image.
func CreateRoute ¶
func CreateRoute(t testing.TB, clients *test.Clients, names test.ResourceNames, fopt ...rtesting.RouteOption) (rt *v1.Route, err error)
CreateRoute creates a route in the given namespace using the route name in names
func CreateService ¶
func CreateService(t testing.TB, clients *test.Clients, names test.ResourceNames, fopt ...rtesting.ServiceOption) (*v1.Service, error)
CreateService creates a service in namespace with the name names.Service and names.Image
func DeleteService ¶ added in v0.26.0
DeleteService deletes a service.
func GetConfigurations ¶ added in v0.27.0
func GetConfigurations(clients *test.Clients) (list *v1.ConfigurationList, err error)
GetConfigurations returns all the available configurations
func GetRevision ¶ added in v0.26.0
GetRevision return a revision by name
func GetRevisions ¶ added in v0.26.0
func GetRevisions(clients *test.Clients) (list *v1.RevisionList, err error)
GetRevisions return all the available revisions
func GetServices ¶ added in v0.26.0
func GetServices(clients *test.Clients) (list *v1.ServiceList, err error)
GetServices gets a list of services.
func IsConfigurationReady ¶ added in v0.12.0
func IsConfigurationReady(c *v1.Configuration) (bool, error)
IsConfigurationReady will check the status conditions of the config and return true if the config is ready. This means it has at least created one revision and that has become ready.
func IsRevisionAtExpectedGeneration ¶
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 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 IsRevisionRoutingActive ¶ added in v0.18.0
IsRevisionRoutingActive will check if the revision is actively routing to a route.
func IsRouteFailed ¶ added in v0.16.0
IsRouteFailed will check the status conditions of the route and return true if the route is not ready.
func IsRouteReady ¶
IsRouteReady will check the status conditions of the route and return true if the route is ready.
func IsServiceAndChildrenFailed ¶ added in v0.16.0
IsServiceAndChildrenFailed will check the readiness, route and config conditions of the service and return true if they are all failed.
func IsServiceFailed ¶ added in v0.16.0
IsServiceFailed will check the status conditions of the service and return true if the service is not 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 IsServiceRoutesNotReady ¶ added in v0.14.0
IsServiceRoutesNotReady checks the RoutesReady status of the service and returns true only if RoutesReady is set to False.
func LogResourceObject ¶
func LogResourceObject(t testing.TB, value ResourceObjects)
LogResourceObject logs the resource object with the resource name and value
func PatchConfig ¶
func PatchConfig(t testing.TB, clients *test.Clients, config *v1.Configuration, fopt ...rtesting.ConfigOption) (cfg *v1.Configuration, err error)
PatchConfig patches the existing configuration passed in with the applied mutations. Returns the latest configuration object
func PatchService ¶
func PatchService(t testing.TB, clients *test.Clients, service *v1.Service, fopt ...rtesting.ServiceOption) (svc *v1.Service, err error)
PatchService patches the existing service passed in with the applied mutations. Returns the latest service object
func PatchServiceRouteSpec ¶ added in v0.25.0
func PatchServiceRouteSpec(t testing.TB, clients *test.Clients, names test.ResourceNames, rs v1.RouteSpec) (svc *v1.Service, err error)
PatchServiceRouteSpec patches a service to use the route name in names.
func Route ¶
func Route(names test.ResourceNames, fopt ...rtesting.RouteOption) *v1.Route
Route returns a Route object in namespace using the route and configuration names in names.
func Service ¶
func Service(names test.ResourceNames, fopt ...rtesting.ServiceOption) *v1.Service
Service returns a Service object in namespace with the name names.Service that uses the image specified by names.Image.
func UpdateService ¶ added in v0.25.0
func UpdateService(t testing.TB, clients *test.Clients, names test.ResourceNames, fopt ...rtesting.ServiceOption) (svc *v1.Service, err error)
UpdateService updates the existing service with name in names with the applied mutations. Returns the latest service object
func WaitForConfigLatestPinnedRevision ¶ added in v0.13.0
func WaitForConfigLatestPinnedRevision(clients *test.Clients, names test.ResourceNames) (string, error)
WaitForConfigLatestPinnedRevision enables the check for pinned revision in WaitForConfigLatestRevision.
func WaitForConfigLatestRevision ¶
func WaitForConfigLatestRevision(clients *test.Clients, names test.ResourceNames, ensurePinned bool) (string, error)
WaitForConfigLatestRevision takes a revision in through names and compares it to the current state of LatestCreatedRevisionName in Configuration. Once an update is detected in the LatestCreatedRevisionName, the function waits for the created revision to be set in LatestReadyRevisionName before returning the name of the revision. Make sure to enable ensurePinned flag if the revision has an associated Route.
func WaitForConfigLatestUnpinnedRevision ¶ added in v0.13.0
func WaitForConfigLatestUnpinnedRevision(clients *test.Clients, names test.ResourceNames) (string, error)
WaitForConfigLatestUnpinnedRevision disables the check for pinned revision in WaitForConfigLatestRevision.
func WaitForConfigurationState ¶
func WaitForConfigurationState(client *test.ServingClients, name string, inState func(c *v1.Configuration) (bool, error), desc string) error
WaitForConfigurationState polls the status of the Configuration called name from client every PollInterval until inState returns `true` indicating it is done, returns an error or PollTimeout. 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 WaitForRevisionState ¶
func WaitForRevisionState(client *test.ServingClients, name string, inState func(r *v1.Revision) (bool, error), desc string) error
WaitForRevisionState polls the status of the Revision called name from client every `PollInterval` 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 *test.ServingClients, name string, inState func(r *v1.Route) (bool, error), desc string) error
WaitForRouteState polls the status of the Route called name from client every PollInterval 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 WaitForServiceLatestRevision ¶
WaitForServiceLatestRevision takes a revision in through names and compares it to the current state of LatestCreatedRevisionName in Service. Once an update is detected in the LatestCreatedRevisionName, the function waits for the created revision to be set in LatestReadyRevisionName before returning the name of the revision.
func WaitForServiceState ¶
func WaitForServiceState(client *test.ServingClients, name string, inState func(s *v1.Service) (bool, error), desc string) error
WaitForServiceState polls the status of the Service called name from client every `PollInterval` until `inState` returns `true` indicating it is done, returns an error or PollTimeout. 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 ResourceObjects ¶
type ResourceObjects struct { Route *v1.Route Config *v1.Configuration Service *v1.Service Revision *v1.Revision }
ResourceObjects holds types of the resource objects.
func CreateServiceReady ¶
func CreateServiceReady(t testing.TB, clients *test.Clients, names *test.ResourceNames, fopt ...rtesting.ServiceOption) (*ResourceObjects, error)
CreateServiceReady creates a new Service in state 'Ready'. This function expects Service and Image name passed in through 'names'. Names is updated with the Route and Configuration created by the Service and ResourceObjects is returned with the Service, Route, and Configuration objects. Returns error if the service does not come up correctly.
func GetResourceObjects ¶
func GetResourceObjects(clients *test.Clients, names test.ResourceNames) (*ResourceObjects, error)
GetResourceObjects obtains the services resources from the k8s API server.