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 CreateService(ctx *Context, name, namespace, image string) (*servingv1.Service, error)
- func CreateSubscription(ctx *Context, name string) (*v1alpha1.Subscription, error)
- 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 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 ¶ added in v1.7.2
func CleanupOnInterrupt ¶
CleanupOnInterrupt will execute the function cleanup if an interrupt signal is caught
func CreateDeployment ¶
func CreateService ¶
func CreateSubscription ¶
func CreateSubscription(ctx *Context, name string) (*v1alpha1.Subscription, error)
func IsCSVSucceeded ¶
func IsCSVSucceeded(c *v1alpha1.ClusterServiceVersion, err error) (bool, error)
func IsSubscriptionInstalledCSVPresent ¶
func IsSubscriptionInstalledCSVPresent(s *v1alpha1.Subscription, err error) (bool, error)
func Subscription ¶
func Subscription(subscriptionName string) *v1alpha1.Subscription
func UpdateGlobalProxy ¶ added in v1.7.2
func WaitForClusterServiceVersionState ¶
func WaitForClusterServiceVersionState(ctx *Context, name, namespace string, inState func(s *v1alpha1.ClusterServiceVersion, err error) (bool, error)) (*v1alpha1.ClusterServiceVersion, error)
func WaitForControllerEnvironment ¶ added in v1.7.2
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 ¶ added in v1.7.2
func WithDeploymentReady ¶ added in v1.7.2
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 KubeAggregator *aggregator.Clientset Operator operatorv1alpha1.OperatorV1alpha1Interface Serving *servingversioned.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