Skip to content

Commit 4b8d2fd

Browse files
committed
Adjustments required for kubernetes group update
1 parent e58e348 commit 4b8d2fd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

internal/controller/runtime/client.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package runtime
77
import (
88
"context"
99

10+
"k8s.io/apimachinery/pkg/runtime"
1011
"k8s.io/client-go/rest"
1112
"sigs.k8s.io/controller-runtime/pkg/client"
1213
)
@@ -32,6 +33,7 @@ type (
3233
ClientPatch func(context.Context, client.Object, client.Patch, ...client.PatchOption) error
3334
ClientDeleteAll func(context.Context, client.Object, ...client.DeleteAllOfOption) error
3435
ClientUpdate func(context.Context, client.Object, ...client.UpdateOption) error
36+
ClientApply func(context.Context, runtime.ApplyConfiguration, ...client.ApplyOption) error
3537
)
3638

3739
// ClientWriter implements [client.Writer] by composing assignable functions.
@@ -41,6 +43,7 @@ type ClientWriter struct {
4143
ClientDeleteAll
4244
ClientPatch
4345
ClientUpdate
46+
ClientApply
4447
}
4548

4649
var _ client.Writer = ClientWriter{}
@@ -76,6 +79,10 @@ func (fn ClientUpdate) Update(ctx context.Context, obj client.Object, opts ...cl
7679
return fn(ctx, obj, opts...)
7780
}
7881

82+
func (fn ClientApply) Apply(ctx context.Context, obj runtime.ApplyConfiguration, opts ...client.ApplyOption) error {
83+
return fn(ctx, obj, opts...)
84+
}
85+
7986
// WarningHandler implements [rest.WarningHandler] and [rest.WarningHandlerWithContext] as a single function.
8087
type WarningHandler func(ctx context.Context, code int, agent string, text string)
8188

internal/controller/runtime/pod_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func newPodClient(config *rest.Config) (rest.Interface, error) {
3030
if err != nil {
3131
return nil, err
3232
}
33-
return apiutil.RESTClientForGVK(gvk, false, config, codecs, httpClient)
33+
return apiutil.RESTClientForGVK(gvk, false, false, config, codecs, httpClient)
3434
}
3535

3636
// +kubebuilder:rbac:groups="",resources="pods/exec",verbs={create}

0 commit comments

Comments
 (0)