Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ServerSideApplier ¶
type ServerSideApplier struct { Scheme *runtime.Scheme // Owner becomes the Field Manager for whatever field the Server-Side apply acts on Owner k8scontrollerclient.FieldOwner // contains filtered or unexported fields }
func NewFakeApplier ¶
func NewFakeApplier(scheme *runtime.Scheme, owner string, objs ...runtime.Object) *ServerSideApplier
FakeApplier provides a wrapper around the fake k8s controller client to convert the unsupported apply-type patches to merge patches.
func NewForConfig ¶
func (*ServerSideApplier) Apply ¶
func (c *ServerSideApplier) Apply(ctx context.Context, obj Object, changeFunc interface{}) func() error
Apply returns a function that invokes a change func on an object and performs a server-side apply patch with the result and its status subresource. The given resource must be a pointer to a struct that specifies its Name, Namespace, APIVersion, and Kind at minimum. The given change function must be unary, matching the signature: "func(<obj type>) error". The returned function is suitable for use w/ asyncronous assertions. The underlying value of the given resource pointer is updated to reflect the latest cluster state each time the closure is successfully invoked. Ex. Change the spec of an existing InstallPlan
plan := &InstallPlan{} plan.SetNamespace("ns") plan.SetName("install-123def")
Eventually(c.Apply(plan, func(p *v1alpha1.InstallPlan) error { p.Spec.Approved = true return nil })).Should(Succeed())