Skip to content

Commit

Permalink
Added client reader mock
Browse files Browse the repository at this point in the history
  • Loading branch information
davidf146 committed May 29, 2023
1 parent fb0bdaa commit 87b3ae2
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cbcontainers/state/state_applier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func testStateApplier(t *testing.T, setup StateApplierTestSetup, k8sVersion, nam

setup(mockObjects)

stateApplier := state.NewStateApplier(mockObjects.componentApplier, k8sVersion, mockObjects.secretValuesCreator, logrTesting.NewTestLogger(t))
stateApplier := state.NewStateApplier(testUtilsMocks.NewMockReader(ctrl), mockObjects.componentApplier, k8sVersion, mockObjects.secretValuesCreator, logrTesting.NewTestLogger(t))
return stateApplier.ApplyDesiredState(context.Background(), agentSpec, &models.RegistrySecretValues{}, nil)
}

Expand Down
1 change: 1 addition & 0 deletions cbcontainers/test_utils/mocks/generated.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package mocks

//go:generate mockgen -destination mock_k8s_client.go -package mocks sigs.k8s.io/controller-runtime/pkg/client Client
//go:generate mockgen -destination mock_k8s_client_reader.go -package mocks sigs.k8s.io/controller-runtime/pkg/client Reader
75 changes: 75 additions & 0 deletions cbcontainers/test_utils/mocks/mock_k8s_client_reader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 87b3ae2

Please sign in to comment.