Documentation ¶
Index ¶
- Constants
- Variables
- func CheckDeploymentScale(ctx *Context, ns, name string, scale int) error
- func CleanupAll(t *testing.T, contexts ...*Context)
- func CleanupOnInterrupt(t *testing.T, cleanup func())
- func CreateDeployment(ctx *Context, name, namespace, image string) error
- func CreateIstioGateway(ctx *Context, gateway *unstructured.Unstructured) *unstructured.Unstructured
- func CreateIstioServiceEntry(ctx *Context, serviceEntry *unstructured.Unstructured) *unstructured.Unstructured
- func CreateIstioVirtualService(ctx *Context, virtualService *unstructured.Unstructured) *unstructured.Unstructured
- func CreateService(ctx *Context, name, namespace, image string) (*servingv1.Service, error)
- func CreateSubscription(ctx *Context, name string) (*v1alpha1.Subscription, error)
- func CreateUnstructured(ctx *Context, schema schema.GroupVersionResource, ...) *unstructured.Unstructured
- func IsCSVSucceeded(c *v1alpha1.ClusterServiceVersion, err error) (bool, error)
- func IsServiceReady(s *servingv1.Service, err error) (bool, error)
- func IsSubscriptionInstalledCSVPresent(s *v1alpha1.Subscription, err error) (bool, error)
- func IstioGateway(name, namespace string) *unstructured.Unstructured
- func IstioGatewayWithTls(name, namespace string, host, privateKeyPath, serverCertificatePath string) *unstructured.Unstructured
- func IstioServiceEntryForKnativeServiceTowardsKourier(service *servingv1.Service) *unstructured.Unstructured
- func IstioVirtualServiceForKnativeServiceWithCustomDomain(service *servingv1.Service, gatewayName string, customHostname string) *unstructured.Unstructured
- func Main(m *testing.M)
- func Service(name, namespace, image string, annotations map[string]string) *servingv1.Service
- func Subscription(subscriptionName string) *v1alpha1.Subscription
- func UpdateGlobalProxy(ctx *Context, value string) error
- func WaitForClusterServiceVersionState(ctx *Context, name, namespace string, ...) (*v1alpha1.ClusterServiceVersion, error)
- func WaitForControllerEnvironment(ctx *Context, ns, envName, envValue string) error
- func WaitForOperatorDepsDeleted(ctx *Context) error
- func WaitForRouteState(ctx *Context, name, namespace string, ...) (*routev1.Route, error)
- func WaitForServiceState(ctx *Context, name, namespace string, ...) (*servingv1.Service, error)
- func WaitForSubscriptionState(ctx *Context, name, namespace string, ...) (*v1alpha1.Subscription, error)
- func WithDeploymentGone(ctx *Context, name string, namespace string) error
- func WithDeploymentReady(ctx *Context, name string, namespace string) (*appsv1.Deployment, error)
- func WithOperatorReady(ctx *Context, subscriptionName string) (*v1alpha1.Subscription, error)
- func WithServiceReady(ctx *Context, name, namespace, image string) (*servingv1.Service, error)
- type CleanupFunc
- type Clients
- type Context
- type FlagsStruct
Constants ¶
const ( // Interval specifies the time between two polls. Interval = 10 * time.Second // Timeout specifies the timeout for the function PollImmediate to reach a certain status. Timeout = 5 * time.Minute OperatorsNamespace = "openshift-serverless" OLMNamespace = "openshift-marketplace" ServerlessOperatorPackage = "serverless-operator" )
Variables ¶
var Flags = initializeFlags()
Flags holds the initialized test flags
Functions ¶
func CheckDeploymentScale ¶
func CleanupOnInterrupt ¶
CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught
func CreateDeployment ¶
func CreateIstioGateway ¶
func CreateIstioGateway(ctx *Context, gateway *unstructured.Unstructured) *unstructured.Unstructured
func CreateIstioServiceEntry ¶
func CreateIstioServiceEntry(ctx *Context, serviceEntry *unstructured.Unstructured) *unstructured.Unstructured
func CreateIstioVirtualService ¶
func CreateIstioVirtualService(ctx *Context, virtualService *unstructured.Unstructured) *unstructured.Unstructured
func CreateService ¶
func CreateSubscription ¶
func CreateSubscription(ctx *Context, name string) (*v1alpha1.Subscription, error)
func CreateUnstructured ¶
func CreateUnstructured(ctx *Context, schema schema.GroupVersionResource, unstructured *unstructured.Unstructured) *unstructured.Unstructured
func IsCSVSucceeded ¶
func IsCSVSucceeded(c *v1alpha1.ClusterServiceVersion, err error) (bool, error)
func IsSubscriptionInstalledCSVPresent ¶
func IsSubscriptionInstalledCSVPresent(s *v1alpha1.Subscription, err error) (bool, error)
func IstioGateway ¶
func IstioGateway(name, namespace string) *unstructured.Unstructured
IstioGateway creates an Istio Gateway for HTTP traffic via istio-ingressgateway
func IstioGatewayWithTls ¶
func IstioGatewayWithTls(name, namespace string, host, privateKeyPath, serverCertificatePath string) *unstructured.Unstructured
IstioGatewayWithTls creates an Istio Gateway for HTTPS traffic via istio-ingressgateway for a specific host with a custom domain and certificates. The certificate/privateKey must be already mounted on the istio-ingressgateway on the given paths
func IstioServiceEntryForKnativeServiceTowardsKourier ¶
func IstioServiceEntryForKnativeServiceTowardsKourier(service *servingv1.Service) *unstructured.Unstructured
IstioServiceEntryForKnativeServiceTowardsKourier creates an Istio ServiceEntry for ksvc's svc hostname routing towards the knative kourier-internal gateway
func IstioVirtualServiceForKnativeServiceWithCustomDomain ¶
func IstioVirtualServiceForKnativeServiceWithCustomDomain(service *servingv1.Service, gatewayName string, customHostname string) *unstructured.Unstructured
IstioVirtualServiceForKnativeServiceWithCustomDomain creates an Istio VirtualService to rewrite the host header of a custom domain with the ksvc's svc hostname
func Subscription ¶
func Subscription(subscriptionName string) *v1alpha1.Subscription
func UpdateGlobalProxy ¶
func WaitForClusterServiceVersionState ¶
func WaitForClusterServiceVersionState(ctx *Context, name, namespace string, inState func(s *v1alpha1.ClusterServiceVersion, err error) (bool, error)) (*v1alpha1.ClusterServiceVersion, error)
func WaitForRouteState ¶
func WaitForServiceState ¶
func WaitForSubscriptionState ¶
func WaitForSubscriptionState(ctx *Context, name, namespace string, inState func(s *v1alpha1.Subscription, err error) (bool, error)) (*v1alpha1.Subscription, error)
func WithDeploymentGone ¶
func WithDeploymentReady ¶
func WithOperatorReady ¶
func WithOperatorReady(ctx *Context, subscriptionName string) (*v1alpha1.Subscription, error)
Types ¶
type CleanupFunc ¶
type CleanupFunc func() error
CleanupFunc defines a function that is called when the respective resource should be deleted. When creating resources the user should also create a CleanupFunc and register with the Context
type Clients ¶
type Clients struct { Kube *kubernetes.Clientset Operator operatorv1alpha1.OperatorV1alpha1Interface Serving *servingversioned.Clientset Eventing *eventingversioned.Clientset OLM olmversioned.Interface Dynamic dynamic.Interface Config *rest.Config Route routev1.RouteV1Interface ProxyConfig configV1.ConfigV1Interface ConsoleCLIDownload consolev1.ConsoleCLIDownloadInterface }
Clients holds instances of interfaces for making requests to various APIs
func NewClients ¶
NewClients instantiates and returns several clientsets required for making request to the Knative cluster
type Context ¶
type Context struct { Name string T *testing.T Clients *Clients CleanupList []CleanupFunc }
Context holds objects related to test execution
func SetupClusterAdmin ¶
SetupClusterAdmin returns context for Cluster Admin user
func SetupProjectAdmin ¶
SetupProjectAdmin returns context for Project Admin user
func (*Context) AddToCleanup ¶
func (ctx *Context) AddToCleanup(f CleanupFunc)
AddToCleanup adds the cleanup function as the first function to the cleanup list, we want to delete the last thing first
type FlagsStruct ¶
type FlagsStruct struct { Kubeconfigs string // Path to .kube/config CatalogSource string // CatalogSource in the openshift-marketplace namespace for the serverless-operator Subscription Channel string // serverless-operator Subscription channel }
FlagsStruct is struct that defines testing options