Documentation ¶
Index ¶
- Constants
- func BeControlledBy(owner client.Object) types.GomegaMatcher
- func DeleteIgnoreNotFound(c client.Client, obj client.Object) func(ctx context.Context) error
- func EqualResources(expected corev1alpha1.ResourceList) types.GomegaMatcher
- func GetInstance(srv *fake.FakeRuntimeService, inst *fake.FakeInstance) func() error
- func GetInstanceByUID(srv *fake.FakeRuntimeService, inst *fake.FakeInstance) func() error
- func Instance(srv *fake.FakeRuntimeService, inst *fake.FakeInstance) func() (*fake.FakeInstance, error)
- func NewFakeInstanceWithUID(uid types.UID) *fake.FakeInstance
- func ProtoEqual(expected proto.Message) types.GomegaMatcher
- func RandomString(n int, opts ...RandomStringOption) string
- func SetupContext() context.Context
- func SetupNamespace(c client.Client) *corev1.Namespace
- func SetupNewObject[O interface{ ... }, OStruct any](c client.Client, f func(obj O)) O
- func SetupObject(c client.Client, obj client.Object, f func())
- func UpdateInstance(srv *fake.FakeRuntimeService, inst *fake.FakeInstance, update func()) func() error
- type Charset
- type ClientPromise
- func (d *ClientPromise) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (d *ClientPromise) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (d *ClientPromise) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (d *ClientPromise) FulfillWith(c client.Client, err error) error
- func (d *ClientPromise) Get(ctx context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (d *ClientPromise) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
- func (d *ClientPromise) IsObjectNamespaced(obj runtime.Object) (bool, error)
- func (d *ClientPromise) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (d *ClientPromise) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (d *ClientPromise) RESTMapper() meta.RESTMapper
- func (d *ClientPromise) Scheme() *runtime.Scheme
- func (d *ClientPromise) Status() client.SubResourceWriter
- func (d *ClientPromise) SubResource(subResource string) client.SubResourceClient
- func (d *ClientPromise) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type DelegatingContext
- type RandomStringOption
- type RandomStringOptions
Constants ¶
const LowerCaseAlphabetCharset = "abcdefghijklmnopqrstuvwxyz"
LowerCaseAlphabetCharset is a charset consisting of lower-case alphabet letters.
Variables ¶
This section is empty.
Functions ¶
func BeControlledBy ¶
func BeControlledBy(owner client.Object) types.GomegaMatcher
BeControlledBy matches any object that is controlled by the given owner.
func DeleteIgnoreNotFound ¶
DeleteIgnoreNotFound returns a function to clean up an object if it exists.
func EqualResources ¶
func EqualResources(expected corev1alpha1.ResourceList) types.GomegaMatcher
func GetInstance ¶
func GetInstance(srv *fake.FakeRuntimeService, inst *fake.FakeInstance) func() error
func GetInstanceByUID ¶
func GetInstanceByUID(srv *fake.FakeRuntimeService, inst *fake.FakeInstance) func() error
func Instance ¶
func Instance(srv *fake.FakeRuntimeService, inst *fake.FakeInstance) func() (*fake.FakeInstance, error)
func NewFakeInstanceWithUID ¶
func NewFakeInstanceWithUID(uid types.UID) *fake.FakeInstance
func ProtoEqual ¶
func ProtoEqual(expected proto.Message) types.GomegaMatcher
func RandomString ¶
func RandomString(n int, opts ...RandomStringOption) string
RandomString generates a random string of length n with the given options. If n is negative, RandomString panics.
func SetupContext ¶
func SetupNamespace ¶
SetupNamespace sets up a namespace before each test and tears the namespace down after each test.
func SetupNewObject ¶
func UpdateInstance ¶
func UpdateInstance(srv *fake.FakeRuntimeService, inst *fake.FakeInstance, update func()) func() error
Types ¶
type Charset ¶
type Charset string
Charset specifies an explicit charset to use.
func (Charset) ApplyToRandomString ¶
func (s Charset) ApplyToRandomString(o *RandomStringOptions)
ApplyToRandomString implements RandomStringOption.
type ClientPromise ¶
type ClientPromise struct {
// contains filtered or unexported fields
}
func NewClientPromise ¶
func NewClientPromise() *ClientPromise
func (*ClientPromise) Create ¶
func (d *ClientPromise) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*ClientPromise) Delete ¶
func (d *ClientPromise) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*ClientPromise) DeleteAllOf ¶
func (d *ClientPromise) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
func (*ClientPromise) FulfillWith ¶
func (d *ClientPromise) FulfillWith(c client.Client, err error) error
func (*ClientPromise) GroupVersionKindFor ¶
func (d *ClientPromise) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
func (*ClientPromise) IsObjectNamespaced ¶
func (d *ClientPromise) IsObjectNamespaced(obj runtime.Object) (bool, error)
func (*ClientPromise) List ¶
func (d *ClientPromise) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*ClientPromise) Patch ¶
func (d *ClientPromise) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error
func (*ClientPromise) RESTMapper ¶
func (d *ClientPromise) RESTMapper() meta.RESTMapper
func (*ClientPromise) Scheme ¶
func (d *ClientPromise) Scheme() *runtime.Scheme
func (*ClientPromise) Status ¶
func (d *ClientPromise) Status() client.SubResourceWriter
func (*ClientPromise) SubResource ¶
func (d *ClientPromise) SubResource(subResource string) client.SubResourceClient
func (*ClientPromise) Update ¶
func (d *ClientPromise) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
type DelegatingContext ¶
type DelegatingContext struct {
// contains filtered or unexported fields
}
func NewDelegatingContext ¶
func NewDelegatingContext(ctx context.Context) *DelegatingContext
func (*DelegatingContext) Deadline ¶
func (d *DelegatingContext) Deadline() (deadline time.Time, ok bool)
func (*DelegatingContext) Done ¶
func (d *DelegatingContext) Done() <-chan struct{}
func (*DelegatingContext) Err ¶
func (d *DelegatingContext) Err() error
func (*DelegatingContext) Fulfill ¶
func (d *DelegatingContext) Fulfill(ctx context.Context)
func (*DelegatingContext) Value ¶
func (d *DelegatingContext) Value(key interface{}) interface{}
type RandomStringOption ¶
type RandomStringOption interface { // ApplyToRandomString modifies the given RandomStringOptions with the option settings. ApplyToRandomString(o *RandomStringOptions) }
RandomStringOption is an option to RandomString.
type RandomStringOptions ¶
type RandomStringOptions struct { // Charset overrides the default RandomString charset if non-empty. Charset string }
RandomStringOptions are options for RandomString.
func (*RandomStringOptions) ApplyOptions ¶
func (o *RandomStringOptions) ApplyOptions(opts []RandomStringOption)
ApplyOptions applies the slice of RandomStringOption to the RandomStringOptions.
func (*RandomStringOptions) ApplyToRandomString ¶
func (o *RandomStringOptions) ApplyToRandomString(o2 *RandomStringOptions)
ApplyToRandomString implements RandomStringOption.