operator-framework / operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
https://olm.operatorframework.io
Apache License 2.0
1.69k stars 543 forks source link

Bumping operator-framework API dependency to v0.11.1 breaks OLM #2573

Open fgiloux opened 2 years ago

fgiloux commented 2 years ago

Bug Report

What did you do? Bumped OLM dependency to v0.11.1 (the current latest)

What did you expect to see? OLM needs to work with the newer API version

What did you see instead? Under which circumstances? Build failed due to the newer version of k8s.io/api to v0.23.0:

Error: pkg/controller/operators/suite_test.go:91:3: cannot use []"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1".CustomResourceDefinition{...} (type []"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1".CustomResourceDefinition) as type []*"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1".CustomResourceDefinition in field value
# github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler
Error: pkg/controller/registry/reconciler/reconciler.go:135:7: unknown field 'Handler' in struct literal of type "k8s.io/api/core/v1".Probe
Error: pkg/controller/registry/reconciler/reconciler.go:144:7: unknown field 'Handler' in struct literal of type "k8s.io/api/core/v1".Probe
[...]

Environment

Additional context I will have a closer look at it. Dependencies were bumped in o-f API in this PR: https://github.com/operator-framework/api/pull/212

fgiloux commented 2 years ago

Another side effect of the bump is that logr version was updated from 0.4.0 to 1.2.0. This is a major update with breaking changes. Especially logr.Logger is an interface in v0.4.0, renamed to logr.LogSink, and a new type logr.Logger is defined as a struct.

pkg/controller/operators/openshift/options.go:59:11: invalid operation: c.Log == nil (mismatched types logr.Logger and nil)