Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupAll(contexts ...*Context)
- func CleanupOnInterrupt(t *testing.T, cleanup func())
- func CreateDeployment(ctx *Context, name, namespace, image string) error
- func CreateKubeService(ctx *Context, name, namespace string) (*corev1.Service, error)
- func CreateService(ctx *Context, name, namespace, image string) (*servingv1beta1.Service, error)
- func CreateSubscription(ctx *Context, name string) (*v1alpha1.Subscription, error)
- func IsCSVSucceeded(c *v1alpha1.ClusterServiceVersion, err error) (bool, error)
- func IsServiceReady(s *servingv1beta1.Service, err error) (bool, error)
- func IsSubscriptionInstalledCSVPresent(s *v1alpha1.Subscription, err error) (bool, error)
- func Main(m *testing.M)
- func RouteHasHost(r *routev1.Route, err error) (bool, error)
- func Service(name, namespace, image string) *servingv1beta1.Service
- func Subscription(subscriptionName string) *v1alpha1.Subscription
- func WaitForClusterServiceVersionState(ctx *Context, name, namespace string, ...) (*v1alpha1.ClusterServiceVersion, error)
- func WaitForOperatorDepsDeleted(ctx *Context) error
- func WaitForRouteState(ctx *Context, name, namespace string, ...) (*routev1.Route, error)
- func WaitForServiceState(ctx *Context, name, namespace string, ...) (*servingv1beta1.Service, error)
- func WaitForSubscriptionState(ctx *Context, name, namespace string, ...) (*v1alpha1.Subscription, error)
- func WithOperatorReady(ctx *Context, subscriptionName string) (*v1alpha1.Subscription, error)
- func WithRouteForServiceReady(ctx *Context, serviceName, namespace string) (*routev1.Route, error)
- func WithServiceReady(ctx *Context, name, namespace, image string) (*servingv1beta1.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-operators" OLMNamespace = "openshift-marketplace" ServerlessOperatorPackage = "serverless-operator" )
Variables ¶
var Flags = initializeFlags()
Flags holds the initialized test flags
Functions ¶
func CleanupOnInterrupt ¶
CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught
func CreateDeployment ¶
func CreateKubeService ¶
func CreateService ¶
func CreateService(ctx *Context, name, namespace, image string) (*servingv1beta1.Service, error)
func CreateSubscription ¶
func CreateSubscription(ctx *Context, name string) (*v1alpha1.Subscription, error)
func IsCSVSucceeded ¶
func IsCSVSucceeded(c *v1alpha1.ClusterServiceVersion, err error) (bool, error)
func IsServiceReady ¶
func IsServiceReady(s *servingv1beta1.Service, err error) (bool, error)
func IsSubscriptionInstalledCSVPresent ¶
func IsSubscriptionInstalledCSVPresent(s *v1alpha1.Subscription, err error) (bool, error)
func Service ¶
func Service(name, namespace, image string) *servingv1beta1.Service
func Subscription ¶
func Subscription(subscriptionName string) *v1alpha1.Subscription
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 WaitForServiceState(ctx *Context, name, namespace string, inState func(s *servingv1beta1.Service, err error) (bool, error)) (*servingv1beta1.Service, error)
func WaitForSubscriptionState ¶
func WaitForSubscriptionState(ctx *Context, name, namespace string, inState func(s *v1alpha1.Subscription, err error) (bool, error)) (*v1alpha1.Subscription, error)
func WithOperatorReady ¶
func WithOperatorReady(ctx *Context, subscriptionName string) (*v1alpha1.Subscription, error)
func WithServiceReady ¶
func WithServiceReady(ctx *Context, name, namespace, image string) (*servingv1beta1.Service, 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 KubeAggregator *aggregator.Clientset ServingOperator servingoperatorv1alpha1.OperatorV1alpha1Interface Serving *servingversioned.Clientset OLM olmversioned.Interface Dynamic dynamic.Interface Config *rest.Config Route routev1.RouteV1Interface }
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