Skip to content

Commit

Permalink
Merge pull request #2777 from ahmetb/rename
Browse files Browse the repository at this point in the history
🌱 style: rename fieldmanager to fieldowner
  • Loading branch information
k8s-ci-robot committed Apr 15, 2024
2 parents 08799f6 + 6ecd337 commit 7ff5801
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/client/fieldowner.go
Expand Up @@ -30,28 +30,28 @@ import (
// will be overridden.
func WithFieldOwner(c Client, fieldOwner string) Client {
return &clientWithFieldManager{
manager: fieldOwner,
c: c,
Reader: c,
owner: fieldOwner,
c: c,
Reader: c,
}
}

type clientWithFieldManager struct {
manager string
c Client
owner string
c Client
Reader
}

func (f *clientWithFieldManager) Create(ctx context.Context, obj Object, opts ...CreateOption) error {
return f.c.Create(ctx, obj, append([]CreateOption{FieldOwner(f.manager)}, opts...)...)
return f.c.Create(ctx, obj, append([]CreateOption{FieldOwner(f.owner)}, opts...)...)
}

func (f *clientWithFieldManager) Update(ctx context.Context, obj Object, opts ...UpdateOption) error {
return f.c.Update(ctx, obj, append([]UpdateOption{FieldOwner(f.manager)}, opts...)...)
return f.c.Update(ctx, obj, append([]UpdateOption{FieldOwner(f.owner)}, opts...)...)
}

func (f *clientWithFieldManager) Patch(ctx context.Context, obj Object, patch Patch, opts ...PatchOption) error {
return f.c.Patch(ctx, obj, patch, append([]PatchOption{FieldOwner(f.manager)}, opts...)...)
return f.c.Patch(ctx, obj, patch, append([]PatchOption{FieldOwner(f.owner)}, opts...)...)
}

func (f *clientWithFieldManager) Delete(ctx context.Context, obj Object, opts ...DeleteOption) error {
Expand All @@ -73,15 +73,15 @@ func (f *clientWithFieldManager) IsObjectNamespaced(obj runtime.Object) (bool, e

func (f *clientWithFieldManager) Status() StatusWriter {
return &subresourceClientWithFieldOwner{
owner: f.manager,
owner: f.owner,
subresourceWriter: f.c.Status(),
}
}

func (f *clientWithFieldManager) SubResource(subresource string) SubResourceClient {
c := f.c.SubResource(subresource)
return &subresourceClientWithFieldOwner{
owner: f.manager,
owner: f.owner,
subresourceWriter: c,
SubResourceReader: c,
}
Expand Down
File renamed without changes.

0 comments on commit 7ff5801

Please sign in to comment.