diff --git a/Dockerfile b/Dockerfile index de14b4db9..869365362 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ RUN make go-build # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details -FROM gcr.io/distroless/static:nonroot +FROM registry.access.redhat.com/ubi9/ubi-minimal WORKDIR / COPY --from=builder /workspace/bin/manager . COPY --from=builder /workspace/bin/status-reporter . diff --git a/cmd/main.go b/cmd/main.go index 1df183006..f9f2d91df 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -104,7 +104,6 @@ func main() { ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) - storageclustersSelector := fields.SelectorFromSet(fields.Set{"metadata.name": "storageclusters.ocs.openshift.io"}) subscriptionwebhookSelector := fields.SelectorFromSet(fields.Set{"metadata.name": templates.SubscriptionWebhookName}) mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, @@ -114,10 +113,6 @@ func main() { LeaderElectionID: "7cb6f2e5.ocs.openshift.io", Cache: cache.Options{ ByObject: map[client.Object]cache.ByObject{ - &extv1.CustomResourceDefinition{}: { - // only cache storagecluster crd - Field: storageclustersSelector, - }, &admrv1.ValidatingWebhookConfiguration{}: { // only cache our validation webhook Field: subscriptionwebhookSelector, diff --git a/pkg/utils/predicates.go b/pkg/utils/predicates.go index 236410d60..06051b28c 100644 --- a/pkg/utils/predicates.go +++ b/pkg/utils/predicates.go @@ -19,13 +19,13 @@ func CrdCreateAndDeletePredicate(log *logr.Logger, crdName string, crdExists boo return predicate.Funcs{ CreateFunc: func(_ event.CreateEvent) bool { if !crdExists { - log.Info("CustomResourceDefinition %s was Created.", crdName) + log.Info("CustomResourceDefinition %s was Created.", "CustomResourceDefinition", crdName) } return !crdExists }, DeleteFunc: func(_ event.DeleteEvent) bool { if crdExists { - log.Info("CustomResourceDefinition %s was Deleted.", crdName) + log.Info("CustomResourceDefinition %s was Deleted.", "CustomResourceDefinition", crdName) } return crdExists },