Documentation ¶
Index ¶
- Variables
- func EvaluatePredicates(obj client.Object, predicates []Predicate) []error
- func HasDeletionTimestamp(o client.Object) error
- func MissingDeletionTimestamp(o client.Object) error
- func NotPendingDeletion(o client.Object) error
- func ObjectFoundPredicate(o client.Object) error
- func WrongTypeErr(got, want interface{}) error
- type Predicate
- func AllResourcesAreCurrent() Predicate
- func DeploymentHasEnvVar(containerName, key, value string) Predicate
- func DeploymentMissingEnvVar(containerName, key string) Predicate
- func HasAllAnnotationKeys(keys ...string) Predicate
- func HasAllNomosMetadata() Predicate
- func HasAnnotation(key, value string) Predicate
- func HasAnnotationKey(key string) Predicate
- func HasCorrectResourceRequestsLimits(containerName string, ...) Predicate
- func HasExactlyAnnotationKeys(wantKeys ...string) Predicate
- func HasExactlyImage(containerName, expectImageName, expectImageTag, expectImageDigest string) Predicate
- func HasExactlyLabelKeys(wantKeys ...string) Predicate
- func HasFinalizer(name string) Predicate
- func HasGenerationAtLeast(minGeneration int64) Predicate
- func HasLabel(key, value string) Predicate
- func IsManagedBy(scheme *runtime.Scheme, scope declared.Scope, syncName string) Predicate
- func IsNotManaged(scheme *runtime.Scheme) Predicate
- func MissingAnnotation(key string) Predicate
- func MissingFinalizer(name string) Predicate
- func MissingLabel(key string) Predicate
- func NoConfigSyncMetadata() Predicate
- func ObjectNotFoundPredicate(scheme *runtime.Scheme) Predicate
- func RepoSyncHasRenderingError(errCode, errMessage string) Predicate
- func RepoSyncHasSourceError(errCode, errMessage string) Predicate
- func RepoSyncHasSyncError(errCode, errMessage string) Predicate
- func ResourceVersionEquals(scheme *runtime.Scheme, expected string) Predicate
- func ResourceVersionNotEquals(scheme *runtime.Scheme, unexpected string) Predicate
- func RoleBindingHasName(expectedName string) Predicate
- func RootSyncHasObservedGenerationNoLessThan(generation int64) Predicate
- func RootSyncHasRenderingError(errCode, errMessage string) Predicate
- func RootSyncHasSourceError(errCode, errMessage string) Predicate
- func RootSyncHasSyncError(errCode, errMessage string) Predicate
- func SecretHasKey(key, value string) Predicate
- func SecretMissingKey(key string) Predicate
- func StatusEquals(scheme *runtime.Scheme, expected status.Status) Predicate
- func WatchSyncPredicate() (Predicate, <-chan struct{})
Constants ¶
This section is empty.
Variables ¶
var ErrFailedPredicate = errors.New("failed predicate")
ErrFailedPredicate indicates the the object on the API server does not match the Predicate.
var ErrObjectNotFound = errors.New("object not found")
ErrObjectNotFound indicates that the caller passed a nil object, indicating the object was deleted or never existed.
var ErrWrongType = errors.New("wrong type")
ErrWrongType indicates that the caller passed an object of the incorrect type to the Predicate.
Functions ¶
func EvaluatePredicates ¶
EvaluatePredicates evaluates a list of predicates and returns any errors
func HasDeletionTimestamp ¶
HasDeletionTimestamp is a predicate that tests that an Object has a DeletionTimestamp.
func MissingDeletionTimestamp ¶
MissingDeletionTimestamp is a predicate that tests that an Object does NOT have a DeletionTimestamp.
func NotPendingDeletion ¶
NotPendingDeletion ensures o is not pending deletion.
Check this when the object could be scheduled for deletion, to avoid flaky behavior when we're ensuring we don't want something to be deleted.
func ObjectFoundPredicate ¶
ObjectFoundPredicate returns ErrObjectNotFound if the object is nil (not found).
func WrongTypeErr ¶
func WrongTypeErr(got, want interface{}) error
WrongTypeErr reports that the passed type was not equivalent to the wanted type.
Types ¶
type Predicate ¶
Predicate evaluates a client.Object, returning an error if it fails validation. The object will be nil if the object was deleted or never existed.
func AllResourcesAreCurrent ¶
func AllResourcesAreCurrent() Predicate
AllResourcesAreCurrent ensures that the managed resources are all Current in the ResourceGroup CR.
func DeploymentHasEnvVar ¶
DeploymentHasEnvVar check whether the deployment contains environment variable with specified name and value
func DeploymentMissingEnvVar ¶
DeploymentMissingEnvVar check whether the deployment does not contain environment variable with specified name and value
func HasAllAnnotationKeys ¶
HasAllAnnotationKeys returns a predicate that tests if an Object has the specified annotation keys.
func HasAllNomosMetadata ¶
func HasAllNomosMetadata() Predicate
HasAllNomosMetadata ensures that the object contains the expected nomos labels and annotations.
func HasAnnotation ¶
HasAnnotation returns a predicate that tests if an Object has the specified annotation key/value pair.
func HasAnnotationKey ¶
HasAnnotationKey returns a predicate that tests if an Object has the specified annotation key.
func HasCorrectResourceRequestsLimits ¶
func HasCorrectResourceRequestsLimits(containerName string, cpuRequest, cpuLimit, memoryRequest, memoryLimit resource.Quantity) Predicate
HasCorrectResourceRequestsLimits verify a root/namespace reconciler container has the correct resource requests and limits.
func HasExactlyAnnotationKeys ¶
HasExactlyAnnotationKeys ensures the Object has exactly the passed set of annotations, ignoring values.
func HasExactlyImage ¶
func HasExactlyImage(containerName, expectImageName, expectImageTag, expectImageDigest string) Predicate
HasExactlyImage ensures a container has the expected image.
func HasExactlyLabelKeys ¶
HasExactlyLabelKeys ensures the Object has exactly the passed set of labels, ignoring values.
func HasFinalizer ¶
HasFinalizer returns a predicate that tests that an Object has the specified finalizer.
func HasGenerationAtLeast ¶
HasGenerationAtLeast checks that the object's Generation is greater than or equal to the specified value.
func HasLabel ¶
HasLabel returns a predicate that tests if an Object has the specified label key/value pair.
func IsManagedBy ¶
IsManagedBy checks that the object is managed by configsync, has the expected resource manager, and has a valid resource-id. Use diff.IsManager if you just need a boolean without errors.
func IsNotManaged ¶
IsNotManaged checks that the object is NOT managed by configsync. Use differ.ManagedByConfigSync if you just need a boolean without errors.
func MissingAnnotation ¶
MissingAnnotation returns a predicate that tests that an object does not have a specified annotation.
func MissingFinalizer ¶
MissingFinalizer returns a predicate that tests that an Object does NOT have the specified finalizer.
func MissingLabel ¶
MissingLabel returns a predicate that tests that an object does not have a specified label.
func NoConfigSyncMetadata ¶
func NoConfigSyncMetadata() Predicate
NoConfigSyncMetadata ensures that the object doesn't contain configsync labels and annotations.
func ObjectNotFoundPredicate ¶
ObjectNotFoundPredicate returns an error unless the object is nil (not found).
func RepoSyncHasRenderingError ¶
RepoSyncHasRenderingError returns an error if the RootSync does not have the specified Rendering error code and (optional, partial) message.
func RepoSyncHasSourceError ¶
RepoSyncHasSourceError returns an error if the RootSync does not have the specified Source error code and (optional, partial) message.
func RepoSyncHasSyncError ¶
RepoSyncHasSyncError returns an error if the RootSync does not have the specified Sync error code and (optional, partial) message.
func ResourceVersionEquals ¶
ResourceVersionEquals checks that the object's ResourceVersion matches the specified value.
func ResourceVersionNotEquals ¶
ResourceVersionNotEquals checks that the object's ResourceVersion does NOT match specified value.
func RoleBindingHasName ¶
RoleBindingHasName will check the Rolebindings name and compare it with expected value
func RootSyncHasObservedGenerationNoLessThan ¶
RootSyncHasObservedGenerationNoLessThan returns an error if the RootSync has the observedGeneration less than the expected generation.
func RootSyncHasRenderingError ¶
RootSyncHasRenderingError returns an error if the RootSync does not have the specified Rendering error code and (optional, partial) message.
func RootSyncHasSourceError ¶
RootSyncHasSourceError returns an error if the RootSync does not have the specified Source error code and (optional, partial) message.
func RootSyncHasSyncError ¶
RootSyncHasSyncError returns an error if the RootSync does not have the specified Sync error code and (optional, partial) message.
func SecretHasKey ¶
SecretHasKey checks that the secret contains key with value
func SecretMissingKey ¶
SecretMissingKey checks that the secret does not contain key
func StatusEquals ¶
StatusEquals checks that the object's computed status matches the specified status.
func WatchSyncPredicate ¶
func WatchSyncPredicate() (Predicate, <-chan struct{})
WatchSyncPredicate returns a predicate and a channel. The channel will be closed when the predicate is first called. Use this to block until WatchObject has completed its first LIST call. This will help avoid missed events when WatchObject is run asynchronously.