matchers

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchCondition

func MatchCondition(con *Condition) types.GomegaMatcher

MatchCondition returns a Gomega matcher that checks if a Condition is equal to the expected one. If the passed in 'actual' is not a Condition, the matcher will fail. All fields which are set to their zero value in the expected condition will be ignored. Use one of the TestCondition... constructors to create a Condition that can be used with this matcher.

func MaybeMatch added in v0.12.0

func MaybeMatch(matcher types.GomegaMatcher) types.GomegaMatcher

MaybeMatch returns a Gomega matcher that passes the matching logic to the provided matcher, but always succeeds if the passed in matcher is nil.

Types

type Condition added in v0.13.0

type Condition struct {
	// contains filtered or unexported fields
}

func TestCondition added in v0.13.0

func TestCondition() *Condition

func TestConditionFromCondition added in v0.13.0

func TestConditionFromCondition(con metav1.Condition) *Condition

func TestConditionFromValues added in v0.13.0

func TestConditionFromValues(conType string, status metav1.ConditionStatus, observedGeneration int64, reason, message string, lastTransitionTime metav1.Time) *Condition

func (*Condition) Matches added in v0.13.0

func (c *Condition) Matches(other *Condition) bool

Matches checks if the current Condition matches the other Condition. Note that this method is not symmetrical, meaning that a.Matches(b) may yield a different result than b.Matches(a). The reason for this is that nil fields in the receiver Condition are considered "arbitrary" and will match any value in the other Condition. If both Conditions are nil, they match.

func (*Condition) String added in v0.13.0

func (c *Condition) String() string

func (*Condition) ToCondition added in v0.13.0

func (c *Condition) ToCondition() metav1.Condition

func (*Condition) WithLastTransitionTime added in v0.13.0

func (c *Condition) WithLastTransitionTime(timestamp metav1.Time) *Condition

func (*Condition) WithMessage added in v0.13.0

func (c *Condition) WithMessage(message string) *Condition

func (*Condition) WithObservedGeneration added in v0.13.0

func (c *Condition) WithObservedGeneration(observedGeneration int64) *Condition

func (*Condition) WithReason added in v0.13.0

func (c *Condition) WithReason(reason string) *Condition

func (*Condition) WithStatus added in v0.13.0

func (c *Condition) WithStatus(status metav1.ConditionStatus) *Condition

func (*Condition) WithTimestampTolerance added in v0.13.0

func (c *Condition) WithTimestampTolerance(t time.Duration) *Condition

func (*Condition) WithType added in v0.13.0

func (c *Condition) WithType(conType string) *Condition

Jump to

Keyboard shortcuts

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