Documentation ¶
Index ¶
Constants ¶
const UpsyncDiffAnnotationPrefix = "internal.workload.kcp.io/upsyncdiff"
UpsyncDiffAnnotationPrefix is an internal annotation used on downstream resources to specify a transformation that should be applied during the Upsyncing of the resource to upstream. Format of the annotation is JSONPatch.
Variables ¶
This section is empty.
Functions ¶
func WithStaticLabelSelectorAndInWriteCallsCheck ¶
func WithStaticLabelSelectorAndInWriteCallsCheck(labelSelector labels.Requirements) forwardingregistry.StorageWrapper
WithStaticLabelSelectorAndInWriteCallsCheck returns a StorageWrapper that adds the given label selector to the reading calls (Get, List and Watch), but also checks that write calls (Create or Update) are refused with an error if the resource would not be matched by the given label selector.
Types ¶
type UpsyncerResourceTransformer ¶
type UpsyncerResourceTransformer struct{}
UpsyncerResourceTransformer defines a very simple transformer which transforms the resource by applying a the JSON patch found in the `internal.workload.kcp.io/upsyncdiff` annotation.
func (*UpsyncerResourceTransformer) AfterRead ¶
func (rt *UpsyncerResourceTransformer) AfterRead(client dynamic.ResourceInterface, ctx context.Context, gvr schema.GroupVersionResource, upstreamResource *unstructured.Unstructured, eventType *watch.EventType, subresources ...string) (*unstructured.Unstructured, error)
func (*UpsyncerResourceTransformer) BeforeWrite ¶
func (rt *UpsyncerResourceTransformer) BeforeWrite(client dynamic.ResourceInterface, ctx context.Context, gvr schema.GroupVersionResource, syncerViewResource *unstructured.Unstructured, subresources ...string) (*unstructured.Unstructured, error)