diff --git a/Makefile b/Makefile index b799a65..4e67ad7 100644 --- a/Makefile +++ b/Makefile @@ -54,9 +54,6 @@ ifeq ($(USE_IMAGE_DIGESTS), true) BUNDLE_GEN_FLAGS += --use-image-digests endif -# Set the Operator SDK version to use. By default, what is installed on the system is used. -# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit. -OPERATOR_SDK_VERSION ?= v1.32.0 # Image URL to use all building/pushing image targets IMG ?= ${IMAGE_TAG_BASE}:${IMG_VERSION} @@ -148,7 +145,7 @@ check: check/lint .PHONY: check/lint check/lint: golangci-lint - @$(GL) run \ + @$(GOLANG_LINT) run \ --config .golangci.yml \ --out-format tab \ --skip-dirs etc \ @@ -157,7 +154,7 @@ check/lint: golangci-lint .PHONY: check/lint/fix check/lint/fix: golangci-lint - @$(GL) run \ + @$(GOLANG_LINT) run \ --config .golangci.yml \ --out-format tab \ --skip-dirs etc \ @@ -230,14 +227,16 @@ $(LOCALBIN): ## Tool Binaries KUSTOMIZE ?= $(LOCALBIN)/kustomize -GL ?= $(LOCALBIN)/golangci-lint +GOLANG_LINT ?= $(LOCALBIN)/golangci-lint GOIMPORT ?= $(LOCALBIN)/goimports YQ ?= $(LOCALBIN)/yq ## Tool Versions -KUSTOMIZE_VERSION ?= v3.8.7 +KUSTOMIZE_VERSION ?= v5.3.0 CONTROLLER_TOOLS_VERSION ?= v0.13.0 -CODEGEN_VERSION := v0.27.4 +CODEGEN_VERSION ?= v0.29.0 +GOLANG_LINT_VERSION ?= v1.55.2 +OPERATOR_SDK_VERSION ?= v1.33.0 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize @@ -267,10 +266,10 @@ endif endif .PHONY: golangci-lint -golangci-lint: $(GL) -$(GL): $(LOCALBIN) +golangci-lint: $(GOLANG_LINT) +$(GOLANG_LINT): $(LOCALBIN) @test -s $(LOCALBIN)/golangci-lint || \ - GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.1 + GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANG_LINT_VERSION) .PHONY: goimport goimport: $(GOIMPORT) @@ -285,8 +284,6 @@ $(YQ): $(LOCALBIN) @test -s $(LOCALBIN)/yq || \ GOBIN=$(LOCALBIN) go install github.com/mikefarah/yq/v4@latest - - .PHONY: bundle bundle: manifests kustomize operator-sdk yq ## Generate bundle manifests and metadata, then validate generated files. $(OPERATOR_SDK) generate kustomize manifests -q diff --git a/apis/designer/v1alpha1/zz_generated.deepcopy.go b/apis/designer/v1alpha1/zz_generated.deepcopy.go index 7727cf8..50f54d9 100644 --- a/apis/designer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/designer/v1alpha1/zz_generated.deepcopy.go @@ -21,7 +21,7 @@ limitations under the License. package v1alpha1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) diff --git a/pkg/client/kaoto/informers/externalversions/factory.go b/pkg/client/kaoto/informers/externalversions/factory.go index 99ed2a1..80d1736 100644 --- a/pkg/client/kaoto/informers/externalversions/factory.go +++ b/pkg/client/kaoto/informers/externalversions/factory.go @@ -41,6 +41,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -79,6 +80,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -165,7 +174,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -183,6 +192,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer @@ -238,7 +248,7 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer