v1alpha1

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace is the namespace of the ingress gateway
	Namespace = "knative-serving"

	// GatewayName is the name of the ingress gateway
	GatewayName = networking.KnativeIngressGateway
)

Variables

This section is empty.

Functions

func AllRouteTrafficAtRevision

func AllRouteTrafficAtRevision(names test.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 CheckConfigurationState

func CheckConfigurationState(client *test.ServingAlphaClients, 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 *test.ServingAlphaClients, 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 *test.ServingAlphaClients, 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 *test.ServingAlphaClients, 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 Configuration

Configuration returns a Configuration object in namespace with the name names.Config that uses the image specified by names.Image

func ConfigurationHasCreatedRevision

func ConfigurationHasCreatedRevision(c *v1alpha1.Configuration) (bool, error)

ConfigurationHasCreatedRevision returns whether the Configuration has created a Revision.

func ConfigurationSpec

func ConfigurationSpec(imagePath string) *v1alpha1.ConfigurationSpec

ConfigurationSpec returns the spec of a configuration to be used throughout different CRD helpers.

func CreateConfiguration

func CreateConfiguration(t pkgTest.T, clients *test.Clients, names test.ResourceNames, fopt ...v1alpha1testing.ConfigOption) (*v1alpha1.Configuration, error)

CreateConfiguration create a configuration resource in namespace with the name names.Config that uses the image specified by names.Image.

func CreateLatestService

func CreateLatestService(t pkgTest.T, clients *test.Clients, names test.ResourceNames, fopt ...rtesting.ServiceOption) (*v1alpha1.Service, error)

CreateLatestService creates a service in namespace with the name names.Service and names.Image

func CreateLatestServiceLegacy

func CreateLatestServiceLegacy(t pkgTest.T, clients *test.Clients, names test.ResourceNames, fopt ...rtesting.ServiceOption) (*v1alpha1.Service, error)

CreateLatestServiceLegacy creates a service in namespace with the name names.Service and names.Image

func CreateRoute

func CreateRoute(t pkgTest.T, clients *test.Clients, names test.ResourceNames, fopt ...v1alpha1testing.RouteOption) (*v1alpha1.Route, error)

CreateRoute creates a route in the given namespace using the route name in names

func IsConfigurationReady added in v0.12.0

func IsConfigurationReady(c *v1alpha1.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 IsIngressReady added in v0.12.0

func IsIngressReady(r *v1alpha1.Ingress) (bool, error)

IsIngressReady will check the status conditions of the ingress and return true if the ingress is ready.

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 IsRevisionPinned added in v0.11.0

func IsRevisionPinned(r *v1alpha1.Revision) (bool, error)

IsRevisionPinned will check if the revision is pinned to a route.

func IsRevisionReady

func IsRevisionReady(r *v1alpha1.Revision) (bool, error)

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 IsRouteNotReady added in v0.8.0

func IsRouteNotReady(r *v1alpha1.Route) (bool, error)

IsRouteNotReady will check the status conditions of the route and return true if the route is not ready.

func IsRouteReady

func IsRouteReady(r *v1alpha1.Route) (bool, error)

IsRouteReady will check the status conditions of the route and return true if the route is ready.

func IsServiceNotReady added in v0.8.0

func IsServiceNotReady(s *v1alpha1.Service) (bool, error)

IsServiceNotReady checks the Ready status condition of the service and returns true only if Ready is set to False.

func IsServiceReady

func IsServiceReady(s *v1alpha1.Service) (bool, error)

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.8.0

func IsServiceRoutesNotReady(s *v1alpha1.Service) (bool, error)

IsServiceRoutesNotReady checks the RoutesReady status of the service and returns true only if RoutesReady is set to False.

func LatestService

func LatestService(names test.ResourceNames, fopt ...rtesting.ServiceOption) *v1alpha1.Service

LatestService returns a Service object in namespace with the name names.Service that uses the image specified by names.Image.

func LatestServiceLegacy

func LatestServiceLegacy(names test.ResourceNames, fopt ...rtesting.ServiceOption) *v1alpha1.Service

LatestServiceLegacy returns a DeprecatedRunLatest Service object in namespace with the name names.Service that uses the image specified by names.Image.

func LegacyConfigurationSpec

func LegacyConfigurationSpec(imagePath string) *v1alpha1.ConfigurationSpec

LegacyConfigurationSpec returns the spec of a configuration to be used throughout different CRD helpers.

func LogResourceObject

func LogResourceObject(t pkgTest.T, value ResourceObjects)

LogResourceObject logs the resource object with the resource name and value

func PatchConfigImage

func PatchConfigImage(clients *test.Clients, cfg *v1alpha1.Configuration, imagePath string) (*v1alpha1.Configuration, error)

PatchConfigImage patches the existing config passed in with a new imagePath. Returns the latest Configuration object

func PatchService

func PatchService(t pkgTest.T, clients *test.Clients, curSvc *v1alpha1.Service, desiredSvc *v1alpha1.Service) (*v1alpha1.Service, error)

PatchService creates and applies a patch from the diff between curSvc and desiredSvc. Returns the latest service object.

func PatchServiceImage

func PatchServiceImage(t pkgTest.T, clients *test.Clients, svc *v1alpha1.Service, imagePath string) (*v1alpha1.Service, error)

PatchServiceImage patches the existing service passed in with a new imagePath. Returns the latest service object

func PatchServiceTemplateMetadata

func PatchServiceTemplateMetadata(t pkgTest.T, clients *test.Clients, svc *v1alpha1.Service, metadata metav1.ObjectMeta) (*v1alpha1.Service, error)

PatchServiceTemplateMetadata patches an existing service by adding metadata to the service's RevisionTemplateSpec.

func RestoreGateway added in v0.11.0

func RestoreGateway(t pkgTest.TLegacy, clients *test.Clients, oldGateway v1alpha3.Gateway)

RestoreGateway updates the gateway object to the oldGateway

func RetryingRouteInconsistency

func RetryingRouteInconsistency(innerCheck spoof.ResponseChecker) spoof.ResponseChecker

RetryingRouteInconsistency retries common requests seen when creating a new route TODO(5573): Remove this.

func UpdateServiceRouteSpec

func UpdateServiceRouteSpec(t pkgTest.T, clients *test.Clients, names test.ResourceNames, rs v1alpha1.RouteSpec) (*v1alpha1.Service, error)

UpdateServiceRouteSpec updates a service to use the route name in names.

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.ServingAlphaClients, name string, inState func(c *v1alpha1.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 WaitForIngressState added in v0.12.0

func WaitForIngressState(client *test.NetworkingClients, name string, inState func(r *v1alpha1.Ingress) (bool, error), desc string) error

WaitForIngressState polls the status of the Ingress 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.ServingAlphaClients, name string, inState func(r *v1alpha1.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 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 WaitForRouteState

func WaitForRouteState(client *test.ServingAlphaClients, name string, inState func(r *v1alpha1.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 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 WaitForServiceLatestRevision

func WaitForServiceLatestRevision(clients *test.Clients, names test.ResourceNames) (string, error)

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.ServingAlphaClients, name string, inState func(s *v1alpha1.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    *v1alpha1.Route
	Config   *v1alpha1.Configuration
	Service  *v1alpha1.Service
	Revision *v1alpha1.Revision
}

ResourceObjects holds types of the resource objects.

func CreateRunLatestServiceLegacyReady

func CreateRunLatestServiceLegacyReady(t pkgTest.T, clients *test.Clients, names *test.ResourceNames, fopt ...rtesting.ServiceOption) (*ResourceObjects, error)

CreateRunLatestServiceLegacyReady 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 CreateRunLatestServiceReady

func CreateRunLatestServiceReady(t pkgTest.TLegacy, clients *test.Clients, names *test.ResourceNames, https bool, fopt ...rtesting.ServiceOption) (*ResourceObjects, *spoof.TransportOption, error)

CreateRunLatestServiceReady 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. If this function is called with https == true, the gateway MUST be restored afterwards. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL