Skip to content

Commit

Permalink
update kdp part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
maqiuyujoyce committed Dec 7, 2023
1 parent 78baecc commit fbdae27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions pkg/controller/kccmanager/nocache/clientbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@ package nocache

import (
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
)

// NoCacheClientFunc returns a client without cache.
var NoCacheClientFuncOld = func(cache cache.Cache, config *rest.Config, options client.Options, uncachedObjects ...client.Object) (client.Client, error) {
return client.New(config, options)
}

var NoCacheClientFunc = func(config *rest.Config, options client.Options) (client.Client, error) {
return client.New(config, options)
}
3 changes: 1 addition & 2 deletions pkg/controller/mocktests/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
yamlserializer "k8s.io/apimachinery/pkg/runtime/serializer/yaml"
yamlutil "k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/kubebuilder-declarative-pattern/mockkubeapiserver"
)
Expand All @@ -56,7 +55,7 @@ func (h *Harness) RESTConfig() *rest.Config {
return h.restConfig
}

func (h *Harness) NewClient(cache cache.Cache, config *rest.Config, options client.Options, uncachedObjects ...client.Object) (client.Client, error) {
func (h *Harness) NewClient(config *rest.Config, options client.Options) (client.Client, error) {
if h.Client == nil {
h.Fatalf("WithObjects must be called before NewClient")
}
Expand Down

0 comments on commit fbdae27

Please sign in to comment.