Skip to content

Commit 9aeb638

Browse files
authored
fix: use provided options for serverside apply (#627)
**What problem does this PR solve?**: I noticed that the Patch options passed to the `ServerSideApply` helper functions were not used. As a result the `ForceOwnership` options from handlers such as https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/blob/main/pkg/handlers/generic/lifecycle/utils/secrets.go#L67 was ignored.
1 parent 1bde0bf commit 9aeb638

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/pkg/k8s/client/apply.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ func ServerSideApply(
2525
obj ctrlclient.Object,
2626
opts ...ctrlclient.PatchOption,
2727
) error {
28+
options := []ctrlclient.PatchOption{ctrlclient.FieldOwner(FieldOwner)}
29+
options = append(options, opts...)
2830
err := c.Patch(
2931
ctx,
3032
obj,
3133
ctrlclient.Apply,
32-
ctrlclient.FieldOwner(FieldOwner),
34+
options...,
3335
)
3436
if err != nil {
3537
return fmt.Errorf("server-side apply failed: %w", err)

0 commit comments

Comments
 (0)