matchers

package
v0.0.0-...-9eefff9 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeAvailable

func BeAvailable() types.GomegaMatcher

BeAvailable is a custom gomega matcher to match on a deployment to be available

Expect(deployment).Should(BeAvailable())

func ContainItemWithOLMOwnerWithPrefix

func ContainItemWithOLMOwnerWithPrefix(prefix string) types.GomegaMatcher

ContainItemWithOLMOwnerWithPrefix is a gomega matcher that can be used to assert that a Kubernetes list object contains an item olm.owner label with the provided prefix. This matcher is preferred in case of operator related objects when object name itself does not contain desired prefix, but has olm.owner label which contains it.

var rolebindings rbacv1.RoleBindingList
err = k8s.List(ctx, &rolebindings)
Expect(err).ShouldNot(HaveOccurred(), "failed to list rolebindings")
Expect(&roleBindingsList).Should(ContainItemWithOLMOwnerWithPrefix("test"))

func ContainItemWithPrefix

func ContainItemWithPrefix(prefix string) types.GomegaMatcher

ContainItemWithPrefix is a gomega matcher that can be used to assert that a Kubernetes list object contains an item name with the provided prefix

var rolebindings rbacv1.RoleBindingList
err = k8s.List(ctx, &rolebindings)
Expect(err).ShouldNot(HaveOccurred(), "failed to list rolebindings")
Expect(&roleBindingsList).Should(ContainItemWithPrefix("test"))

Types

This section is empty.

Jump to

Keyboard shortcuts

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