Skip to content

Commit

Permalink
Set nil cache for NoCacheClientFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
maqiuyujoyce committed Dec 9, 2023
1 parent cce2c90 commit ca0afaf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 0 additions & 5 deletions operator/pkg/preflight/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@ func TestUpgradeChecker_Preflight(t *testing.T) {
repo := FakeRepo{
channel: tc.channel,
}
// Adding the wait to avoid the error "the cache is not started, can
// not read objects".
if !mgr.GetCache().WaitForCacheSync(ctx) {
t.Fatalf("the cache in the test manager did not sync")
}
u := NewUpgradeChecker(client, &repo)
err := u.Preflight(ctx, tc.cc)
asserts.AssertErrorIsExpected(t, err, tc.err)
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/kccmanager/nocache/clientbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ import (
)

var NoCacheClientFunc = func(config *rest.Config, options client.Options) (client.Client, error) {
options.Cache = nil
return client.New(config, options)
}

0 comments on commit ca0afaf

Please sign in to comment.