Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyTimeMutator ¶
type ApplyTimeMutator struct { Client dynamic.Interface Mapper meta.RESTMapper ResourceCache cache.ResourceCache }
ApplyTimeMutator mutates an object by injecting values specified by the apply-time-mutation annotation. The optional ResourceCache will be used to speed up source object lookups, if specified. Implements the Mutator interface
func (*ApplyTimeMutator) Mutate ¶
func (atm *ApplyTimeMutator) Mutate(ctx context.Context, obj *unstructured.Unstructured) (bool, string, error)
Mutate parses the apply-time-mutation annotation and loops through the substitutions, applying each of them to the supplied target object. Returns true with a reason, if mutation was performed.
func (*ApplyTimeMutator) Name ¶
func (atm *ApplyTimeMutator) Name() string
Name returns a mutator identifier for logging.
type Interface ¶
type Interface interface { // Name returns a filter name (usually for logging). Name() string // Mutate returns true if the object was mutated. // This allows the mutator to decide if mutation is needed. // If mutated, a reason string is returned. // If an error happens during mutation, it is returned. Mutate(ctx context.Context, obj *unstructured.Unstructured) (bool, string, error) }
Interface decouples apply-time-mutation from the concrete structs used for applying.
Click to show internal directories.
Click to hide internal directories.