Documentation
¶
Index ¶
- Variables
- func BeHeadless() gtypes.GomegaMatcher
- func ConsistOfFinalizers(finalizers ...string) gtypes.GomegaMatcher
- func Exist() gtypes.GomegaMatcher
- func ExistAnd(matchers ...gtypes.GomegaMatcher) gtypes.GomegaMatcher
- func GVK(gvk schema.GroupVersionKind, optionalClient ...client.Client) func() (*meta.RESTMapping, error)
- func HaveAnnotations(keysAndValues ...string) gtypes.GomegaMatcher
- func HaveData(keysAndValues ...interface{}) gtypes.GomegaMatcher
- func HaveEnv(keysAndValues ...interface{}) gtypes.GomegaMatcher
- func HaveFinalizers(finalizers ...string) gtypes.GomegaMatcher
- func HaveImage(image string, maybeImagePullPolicy ...corev1.PullPolicy) gtypes.GomegaMatcher
- func HaveImagePullSecrets(secrets ...string) gtypes.GomegaMatcher
- func HaveJsonPath(jsonPath string, optionalValue ...string) gtypes.GomegaMatcher
- func HaveLabels(keysAndValues ...string) gtypes.GomegaMatcher
- func HaveLimits(limitTypeOrSpec interface{}) gtypes.GomegaMatcher
- func HaveMatchingContainer(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
- func HaveMatchingInitContainer(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
- func HaveMatchingPersistentVolume(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
- func HaveMatchingVolume(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
- func HaveName(name string) gtypes.GomegaMatcher
- func HaveNamespace(namespace string) gtypes.GomegaMatcher
- func HaveNodeSelector(keysAndValues ...string) gtypes.GomegaMatcher
- func HaveOwner(owner client.Object) gtypes.GomegaMatcher
- func HavePorts(intsOrStrings ...interface{}) gtypes.GomegaMatcher
- func HaveReplicaCount(replicaCount int32) gtypes.GomegaMatcher
- func HaveStorageClass(storageClass string) gtypes.GomegaMatcher
- func HaveSuccessfulRollout() gtypes.GomegaMatcher
- func HaveTolerations(tolerationsOrKeys ...interface{}) gtypes.GomegaMatcher
- func HaveType(t corev1.ServiceType) gtypes.GomegaMatcher
- func HaveVolumeMounts(volumeMountNamesOrSpecs ...interface{}) gtypes.GomegaMatcher
- func HaveVolumeSource(source interface{}) gtypes.GomegaMatcher
- func List(list client.ObjectList, opts *client.ListOptions, ...) func() ([]client.Object, error)
- func MatchStatus(predicate interface{}) gtypes.GomegaMatcher
- func Object[T client.Object](obj T, optionalClient ...client.Client) func() (T, error)
- func SetDefaultObjectClient(client client.Client)
- type AnnotationMatcher
- type ContainerMatcher
- type DataMatcher
- type EnvVarMatcher
- type ExistenceMatcher
- type FinalizerMatcher
- type HeadlessMatcher
- type ImageMatcher
- type ImagePullSecretsMatcher
- type InitContainerMatcher
- type LabelMatcher
- type LimitMatcher
- type NameMatcher
- type NamespaceMatcher
- type NodeSelectorMatcher
- type OwnershipMatcher
- type PersistentVolumeMatcher
- type PortMatcher
- type Predicate
- type ReplicaCountMatcher
- type RolloutMatcher
- type ServiceTypeMatcher
- type StatusMatcher
- type StorageClassMatcher
- type TolerationMatcher
- type VolumeMatcher
- type VolumeMountMatcher
- type VolumeSourceMatcher
- type VolumeSourceObjectMatcher
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupportedObjectType = errors.New("unsupported object type") ErrNotAClientObject = errors.New("target is not a client.Object") )
Functions ¶
func BeHeadless ¶
func BeHeadless() gtypes.GomegaMatcher
func ConsistOfFinalizers ¶
func ConsistOfFinalizers(finalizers ...string) gtypes.GomegaMatcher
func Exist ¶
func Exist() gtypes.GomegaMatcher
func ExistAnd ¶
func ExistAnd(matchers ...gtypes.GomegaMatcher) gtypes.GomegaMatcher
ExistAnd should be used in place of And(Exist(), ...), both because it makes more sense grammatically and Exists always needs to be checked, due to differences between Eventually and Consistently.
func GVK ¶
func GVK( gvk schema.GroupVersionKind, optionalClient ...client.Client, ) func() (*meta.RESTMapping, error)
func HaveAnnotations ¶
func HaveAnnotations(keysAndValues ...string) gtypes.GomegaMatcher
func HaveData ¶
func HaveData(keysAndValues ...interface{}) gtypes.GomegaMatcher
func HaveEnv ¶
func HaveEnv(keysAndValues ...interface{}) gtypes.GomegaMatcher
keysAndValues should alternate between key names (string) and values which could be any string-convertible type, a SecretKeySelector or ConfigMapSelector, or nil, indicating any value is allowed.
func HaveFinalizers ¶
func HaveFinalizers(finalizers ...string) gtypes.GomegaMatcher
func HaveImage ¶
func HaveImage(image string, maybeImagePullPolicy ...corev1.PullPolicy) gtypes.GomegaMatcher
func HaveImagePullSecrets ¶
func HaveImagePullSecrets(secrets ...string) gtypes.GomegaMatcher
func HaveJsonPath ¶
func HaveJsonPath(jsonPath string, optionalValue ...string) gtypes.GomegaMatcher
HaveJsonPath is a Gomega matcher that mirrors the (extended) behvaiour of jsonpath on unstructured objects
func HaveLabels ¶
func HaveLabels(keysAndValues ...string) gtypes.GomegaMatcher
func HaveLimits ¶
func HaveLimits(limitTypeOrSpec interface{}) gtypes.GomegaMatcher
func HaveMatchingContainer ¶
func HaveMatchingContainer(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
func HaveMatchingInitContainer ¶
func HaveMatchingInitContainer(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
func HaveMatchingPersistentVolume ¶
func HaveMatchingPersistentVolume(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
func HaveMatchingVolume ¶
func HaveMatchingVolume(matcher gtypes.GomegaMatcher) gtypes.GomegaMatcher
func HaveName ¶
func HaveName(name string) gtypes.GomegaMatcher
func HaveNamespace ¶
func HaveNamespace(namespace string) gtypes.GomegaMatcher
func HaveNodeSelector ¶
func HaveNodeSelector(keysAndValues ...string) gtypes.GomegaMatcher
func HavePorts ¶
func HavePorts(intsOrStrings ...interface{}) gtypes.GomegaMatcher
intsOrStrings can accept either an int port number or string port name.
func HaveReplicaCount ¶
func HaveReplicaCount(replicaCount int32) gtypes.GomegaMatcher
func HaveStorageClass ¶
func HaveStorageClass(storageClass string) gtypes.GomegaMatcher
func HaveSuccessfulRollout ¶
func HaveSuccessfulRollout() gtypes.GomegaMatcher
func HaveTolerations ¶
func HaveTolerations(tolerationsOrKeys ...interface{}) gtypes.GomegaMatcher
func HaveType ¶
func HaveType(t corev1.ServiceType) gtypes.GomegaMatcher
func HaveVolumeMounts ¶
func HaveVolumeMounts(volumeMountNamesOrSpecs ...interface{}) gtypes.GomegaMatcher
func HaveVolumeSource ¶
func HaveVolumeSource(source interface{}) gtypes.GomegaMatcher
source is the field name in a VolumeSource or PersistentVolumeSource, or a corev1.VolumeSource object to compare against
func List ¶
func List( list client.ObjectList, opts *client.ListOptions, optionalClient ...client.Client, ) func() ([]client.Object, error)
func MatchStatus ¶
func MatchStatus(predicate interface{}) gtypes.GomegaMatcher
func Object ¶
Object returns a function that will look up the object with the given name and namespace in the cluster using the provided client. The client argument is optional. If it is not provided, a default client must be set previously using SetDefaultObjectClient. As a special case, the IsNotFound error is ignored.
func SetDefaultObjectClient ¶
Types ¶
type AnnotationMatcher ¶
type AnnotationMatcher struct {
// contains filtered or unexported fields
}
func (AnnotationMatcher) FailureMessage ¶
func (o AnnotationMatcher) FailureMessage(target interface{}) (message string)
func (AnnotationMatcher) Match ¶
func (o AnnotationMatcher) Match(target interface{}) (success bool, err error)
func (AnnotationMatcher) NegatedFailureMessage ¶
func (o AnnotationMatcher) NegatedFailureMessage(target interface{}) (message string)
type ContainerMatcher ¶
type ContainerMatcher struct {
Matcher gtypes.GomegaMatcher
}
func (ContainerMatcher) FailureMessage ¶
func (o ContainerMatcher) FailureMessage(target interface{}) (message string)
func (ContainerMatcher) Match ¶
func (o ContainerMatcher) Match(target interface{}) (_ bool, err error)
func (ContainerMatcher) NegatedFailureMessage ¶
func (o ContainerMatcher) NegatedFailureMessage(target interface{}) (message string)
type DataMatcher ¶
type DataMatcher struct {
// contains filtered or unexported fields
}
func (DataMatcher) FailureMessage ¶
func (o DataMatcher) FailureMessage(target interface{}) (message string)
func (DataMatcher) Match ¶
func (o DataMatcher) Match(target interface{}) (success bool, err error)
func (DataMatcher) NegatedFailureMessage ¶
func (o DataMatcher) NegatedFailureMessage(target interface{}) (message string)
type EnvVarMatcher ¶
type EnvVarMatcher struct {
KeysAndValues map[string]interface{}
}
func (EnvVarMatcher) FailureMessage ¶
func (o EnvVarMatcher) FailureMessage(target interface{}) (message string)
func (EnvVarMatcher) Match ¶
func (o EnvVarMatcher) Match(target interface{}) (success bool, err error)
func (EnvVarMatcher) NegatedFailureMessage ¶
func (o EnvVarMatcher) NegatedFailureMessage(target interface{}) (message string)
type ExistenceMatcher ¶
type ExistenceMatcher struct{}
func (ExistenceMatcher) FailureMessage ¶
func (o ExistenceMatcher) FailureMessage(target interface{}) (message string)
func (ExistenceMatcher) Match ¶
func (o ExistenceMatcher) Match(target interface{}) (success bool, err error)
func (ExistenceMatcher) NegatedFailureMessage ¶
func (o ExistenceMatcher) NegatedFailureMessage(target interface{}) (message string)
type FinalizerMatcher ¶
type FinalizerMatcher struct { Finalizers []string // contains filtered or unexported fields }
func (FinalizerMatcher) FailureMessage ¶
func (m FinalizerMatcher) FailureMessage(target interface{}) (message string)
func (FinalizerMatcher) Match ¶
func (m FinalizerMatcher) Match(target interface{}) (success bool, err error)
func (FinalizerMatcher) NegatedFailureMessage ¶
func (m FinalizerMatcher) NegatedFailureMessage(target interface{}) (message string)
type HeadlessMatcher ¶
type HeadlessMatcher struct{}
func (HeadlessMatcher) FailureMessage ¶
func (o HeadlessMatcher) FailureMessage(target interface{}) (message string)
func (HeadlessMatcher) Match ¶
func (o HeadlessMatcher) Match(target interface{}) (success bool, err error)
func (HeadlessMatcher) NegatedFailureMessage ¶
func (o HeadlessMatcher) NegatedFailureMessage(target interface{}) (message string)
type ImageMatcher ¶
type ImageMatcher struct { Image string PullPolicy *corev1.PullPolicy }
func (ImageMatcher) FailureMessage ¶
func (o ImageMatcher) FailureMessage(target interface{}) (message string)
func (ImageMatcher) Match ¶
func (o ImageMatcher) Match(target interface{}) (success bool, err error)
func (ImageMatcher) NegatedFailureMessage ¶
func (o ImageMatcher) NegatedFailureMessage(target interface{}) (message string)
type ImagePullSecretsMatcher ¶
type ImagePullSecretsMatcher struct {
Secrets []string
}
func (ImagePullSecretsMatcher) FailureMessage ¶
func (o ImagePullSecretsMatcher) FailureMessage(target interface{}) (message string)
func (ImagePullSecretsMatcher) Match ¶
func (o ImagePullSecretsMatcher) Match(target interface{}) (success bool, err error)
func (ImagePullSecretsMatcher) NegatedFailureMessage ¶
func (o ImagePullSecretsMatcher) NegatedFailureMessage(target interface{}) (message string)
type InitContainerMatcher ¶
type InitContainerMatcher struct {
Matcher gtypes.GomegaMatcher
}
func (InitContainerMatcher) FailureMessage ¶
func (o InitContainerMatcher) FailureMessage(target interface{}) (message string)
func (InitContainerMatcher) Match ¶
func (o InitContainerMatcher) Match(target interface{}) (_ bool, err error)
func (InitContainerMatcher) NegatedFailureMessage ¶
func (o InitContainerMatcher) NegatedFailureMessage(target interface{}) (message string)
type LabelMatcher ¶
type LabelMatcher struct {
// contains filtered or unexported fields
}
func (LabelMatcher) FailureMessage ¶
func (o LabelMatcher) FailureMessage(target interface{}) (message string)
func (LabelMatcher) Match ¶
func (o LabelMatcher) Match(target interface{}) (success bool, err error)
func (LabelMatcher) NegatedFailureMessage ¶
func (o LabelMatcher) NegatedFailureMessage(target interface{}) (message string)
type LimitMatcher ¶
type LimitMatcher struct {
Limits interface{}
}
func (LimitMatcher) FailureMessage ¶
func (o LimitMatcher) FailureMessage(target interface{}) (message string)
func (LimitMatcher) Match ¶
func (o LimitMatcher) Match(target interface{}) (success bool, err error)
func (LimitMatcher) NegatedFailureMessage ¶
func (o LimitMatcher) NegatedFailureMessage(target interface{}) (message string)
type NameMatcher ¶
type NameMatcher struct {
Name string
}
func (NameMatcher) FailureMessage ¶
func (o NameMatcher) FailureMessage(target interface{}) (message string)
func (NameMatcher) Match ¶
func (o NameMatcher) Match(target interface{}) (success bool, err error)
func (NameMatcher) NegatedFailureMessage ¶
func (o NameMatcher) NegatedFailureMessage(target interface{}) (message string)
type NamespaceMatcher ¶
type NamespaceMatcher struct {
Namespace string
}
func (NamespaceMatcher) FailureMessage ¶
func (o NamespaceMatcher) FailureMessage(target interface{}) (message string)
func (NamespaceMatcher) Match ¶
func (o NamespaceMatcher) Match(target interface{}) (success bool, err error)
func (NamespaceMatcher) NegatedFailureMessage ¶
func (o NamespaceMatcher) NegatedFailureMessage(target interface{}) (message string)
type NodeSelectorMatcher ¶
type NodeSelectorMatcher struct {
// contains filtered or unexported fields
}
func (NodeSelectorMatcher) FailureMessage ¶
func (o NodeSelectorMatcher) FailureMessage(target interface{}) (message string)
func (NodeSelectorMatcher) Match ¶
func (o NodeSelectorMatcher) Match(target interface{}) (success bool, err error)
func (NodeSelectorMatcher) NegatedFailureMessage ¶
func (o NodeSelectorMatcher) NegatedFailureMessage(target interface{}) (message string)
type OwnershipMatcher ¶
func (OwnershipMatcher) FailureMessage ¶
func (o OwnershipMatcher) FailureMessage(target interface{}) (message string)
func (OwnershipMatcher) Match ¶
func (o OwnershipMatcher) Match(target interface{}) (success bool, err error)
func (OwnershipMatcher) NegatedFailureMessage ¶
func (o OwnershipMatcher) NegatedFailureMessage(target interface{}) (message string)
type PersistentVolumeMatcher ¶
type PersistentVolumeMatcher struct {
// contains filtered or unexported fields
}
func (PersistentVolumeMatcher) FailureMessage ¶
func (o PersistentVolumeMatcher) FailureMessage(target interface{}) (message string)
func (PersistentVolumeMatcher) Match ¶
func (o PersistentVolumeMatcher) Match(target interface{}) (success bool, err error)
func (PersistentVolumeMatcher) NegatedFailureMessage ¶
func (o PersistentVolumeMatcher) NegatedFailureMessage(target interface{}) (message string)
type PortMatcher ¶
type PortMatcher struct {
Ports []intstr.IntOrString
}
func (PortMatcher) FailureMessage ¶
func (o PortMatcher) FailureMessage(target interface{}) (message string)
func (PortMatcher) Match ¶
func (o PortMatcher) Match(target interface{}) (success bool, err error)
func (PortMatcher) NegatedFailureMessage ¶
func (o PortMatcher) NegatedFailureMessage(target interface{}) (message string)
type ReplicaCountMatcher ¶
type ReplicaCountMatcher struct {
ReplicaCount int32
}
func (ReplicaCountMatcher) FailureMessage ¶
func (o ReplicaCountMatcher) FailureMessage(target interface{}) (message string)
func (ReplicaCountMatcher) Match ¶
func (o ReplicaCountMatcher) Match(target interface{}) (success bool, err error)
func (ReplicaCountMatcher) NegatedFailureMessage ¶
func (o ReplicaCountMatcher) NegatedFailureMessage(target interface{}) (message string)
type RolloutMatcher ¶
type RolloutMatcher struct{}
RolloutMatcher is a Gomega matcher that checks if a deployment, statefulset, or daemonset has completed its rollout.
!! Warning: This is a runtime matcher, requires a running control plane to correctly match the rollout status
Reference : https://github.com/kubernetes/kubectl/blob/master/pkg/polymorphichelpers/rollout_status.go
func (RolloutMatcher) FailureMessage ¶
func (o RolloutMatcher) FailureMessage(target interface{}) (message string)
func (RolloutMatcher) Match ¶
func (o RolloutMatcher) Match(target interface{}) (success bool, err error)
func (RolloutMatcher) NegatedFailureMessage ¶
func (o RolloutMatcher) NegatedFailureMessage(target interface{}) (message string)
type ServiceTypeMatcher ¶
type ServiceTypeMatcher struct {
Type corev1.ServiceType
}
func (ServiceTypeMatcher) FailureMessage ¶
func (o ServiceTypeMatcher) FailureMessage(target interface{}) (message string)
func (ServiceTypeMatcher) Match ¶
func (o ServiceTypeMatcher) Match(target interface{}) (success bool, err error)
func (ServiceTypeMatcher) NegatedFailureMessage ¶
func (o ServiceTypeMatcher) NegatedFailureMessage(target interface{}) (message string)
type StatusMatcher ¶
func (StatusMatcher) FailureMessage ¶
func (o StatusMatcher) FailureMessage(target interface{}) (message string)
func (StatusMatcher) Match ¶
func (o StatusMatcher) Match(target interface{}) (success bool, err error)
func (StatusMatcher) NegatedFailureMessage ¶
func (o StatusMatcher) NegatedFailureMessage(target interface{}) (message string)
type StorageClassMatcher ¶
type StorageClassMatcher struct {
StorageClass string
}
func (StorageClassMatcher) FailureMessage ¶
func (o StorageClassMatcher) FailureMessage(target interface{}) (message string)
func (StorageClassMatcher) Match ¶
func (o StorageClassMatcher) Match(target interface{}) (success bool, err error)
func (StorageClassMatcher) NegatedFailureMessage ¶
func (o StorageClassMatcher) NegatedFailureMessage(target interface{}) (message string)
type TolerationMatcher ¶
type TolerationMatcher struct {
Tolerations []interface{}
}
func (TolerationMatcher) FailureMessage ¶
func (o TolerationMatcher) FailureMessage(target interface{}) (message string)
func (TolerationMatcher) Match ¶
func (o TolerationMatcher) Match(target interface{}) (success bool, err error)
func (TolerationMatcher) NegatedFailureMessage ¶
func (o TolerationMatcher) NegatedFailureMessage(target interface{}) (message string)
type VolumeMatcher ¶
type VolumeMatcher struct { Matcher gtypes.GomegaMatcher Volumes []corev1.Volume }
func (*VolumeMatcher) FailureMessage ¶
func (o *VolumeMatcher) FailureMessage(target interface{}) (message string)
func (*VolumeMatcher) Match ¶
func (o *VolumeMatcher) Match(target interface{}) (bool, error)
func (*VolumeMatcher) NegatedFailureMessage ¶
func (o *VolumeMatcher) NegatedFailureMessage(target interface{}) (message string)
type VolumeMountMatcher ¶
type VolumeMountMatcher struct {
VolumeMounts []interface{}
}
func (VolumeMountMatcher) FailureMessage ¶
func (o VolumeMountMatcher) FailureMessage(target interface{}) (message string)
func (VolumeMountMatcher) Match ¶
func (o VolumeMountMatcher) Match(target interface{}) (success bool, err error)
func (VolumeMountMatcher) NegatedFailureMessage ¶
func (o VolumeMountMatcher) NegatedFailureMessage(target interface{}) (message string)
type VolumeSourceMatcher ¶
type VolumeSourceMatcher struct {
Source string
}
func (VolumeSourceMatcher) FailureMessage ¶
func (o VolumeSourceMatcher) FailureMessage(target interface{}) (message string)
func (VolumeSourceMatcher) Match ¶
func (o VolumeSourceMatcher) Match(target interface{}) (success bool, err error)
func (VolumeSourceMatcher) NegatedFailureMessage ¶
func (o VolumeSourceMatcher) NegatedFailureMessage(target interface{}) (message string)
type VolumeSourceObjectMatcher ¶
type VolumeSourceObjectMatcher struct {
VolumeSource corev1.VolumeSource
}
func (VolumeSourceObjectMatcher) FailureMessage ¶
func (o VolumeSourceObjectMatcher) FailureMessage(target interface{}) (message string)
func (VolumeSourceObjectMatcher) Match ¶
func (o VolumeSourceObjectMatcher) Match(target interface{}) (success bool, err error)
func (VolumeSourceObjectMatcher) NegatedFailureMessage ¶
func (o VolumeSourceObjectMatcher) NegatedFailureMessage(target interface{}) (message string)