From 7d32c63592a438cd6084fd4ff4dfc2ae39176552 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Fri, 30 Dec 2022 16:23:34 +0100 Subject: [PATCH] Add additional SubResource* functions for FieldOwner This enhances #2072 to allow FieldOwner work with SubResources to set the FieldManager option. --- pkg/client/options.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/client/options.go b/pkg/client/options.go index c8fa0dc797..7a788f1b80 100644 --- a/pkg/client/options.go +++ b/pkg/client/options.go @@ -154,6 +154,23 @@ func (f FieldOwner) ApplyToUpdate(opts *UpdateOptions) { opts.FieldManager = string(f) } +// ApplyToSubResourcePatch applies this configuration to the given patch options. +func (f FieldOwner) ApplyToSubResourcePatch(opts *SubResourcePatchOptions) { + opts.FieldManager = string(f) +} + +// ApplyToSubResourceCreate applies this configuration to the given create options. +func (f FieldOwner) ApplyToSubResourceCreate(opts *SubResourceCreateOptions) { + opts.FieldManager = string(f) +} + +// ApplyToSubResourceUpdate applies this configuration to the given update options. +func (f FieldOwner) ApplyToSubResourceUpdate(opts *SubResourceUpdateOptions) { + opts.FieldManager = string(f) +} + + + // }}} // {{{ Create Options