Skip to content

Commit 7163020

Browse files
committed
fix controller-runtime v0.22.1 Apply method missing
1 parent e814592 commit 7163020

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ import (
1919
"sigs.k8s.io/controller-runtime/pkg/reconcile"
2020
)
2121

22+
type clientWithApply struct{ *mockclients.MockClient }
23+
24+
// Satisfy controller-runtime v0.22.1 Writer.Apply:
25+
func (c clientWithApply) Apply(ctx context.Context, ac runtime.ApplyConfiguration, opts ...ctrlclient.ApplyOption) error {
26+
return nil // not used in these tests
27+
}
28+
29+
2230
var _ = Describe("multiTenantCrdReconciler", func() {
2331
var kubeClient *mockclients.MockClient
2432
var cnsRestService *mockclients.MockcnsRESTservice
@@ -43,7 +51,7 @@ var _ = Describe("multiTenantCrdReconciler", func() {
4351
cnsRestService = mockclients.NewMockcnsRESTservice(mockCtl)
4452
statusWriter = mockclients.NewMockSubResourceWriter(mockCtl)
4553
reconciler = &multiTenantCrdReconciler{
46-
KubeClient: kubeClient,
54+
KubeClient: clientWithApply{kubeClient},
4755
NodeName: mockNodeName,
4856
CNSRestService: cnsRestService,
4957
}

0 commit comments

Comments
 (0)