redhat-cop / operator-utils

Utilities to support operators
Apache License 2.0
153 stars 37 forks source link

Build errors when adding operator-utils to a new operator-sdk v1.2 generated project #42

Closed avrahams closed 3 years ago

avrahams commented 3 years ago

I generated a new operator with operator-sdk init and used operator-sdk create api and built it with make with no errors

I am using operator-sdk v1.2

But once I add github.com/redhat-cop/operator-utils v0.3.7 to go.mod I get these build errors

k8s.io/client-go/tools/clientcmd/api/v1 /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:29:15: scheme.AddConversionFuncs undefined (type *runtime.Scheme has no field or method AddConversionFuncs) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:31:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:34:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:37:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:40:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:43:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:46:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:49:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) /home/avrahams/go/pkg/mod/k8s.io/client-go@v12.0.0+incompatible/tools/clientcmd/api/v1/conversion.go:52:12: s.DefaultConvert undefined (type conversion.Scope has no field or method DefaultConvert) sigs.k8s.io/controller-runtime/pkg/metrics /home/avrahams/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.3/pkg/metrics/client_go_adapter.go:133:24: not enough arguments in call to metrics.Register /home/avrahams/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.3/pkg/metrics/client_go_adapter.go:133:25: undefined: metrics.RegisterOpts

The original go.mod that was generated by the operator-sdk was `require (

github.com/go-logr/logr v0.1.0

github.com/onsi/ginkgo v1.12.1

github.com/onsi/gomega v1.10.1

k8s.io/apimachinery v0.18.6

k8s.io/client-go v0.18.6

sigs.k8s.io/controller-runtime v0.6.3

)`

raffaelespazzoli commented 3 years ago

currently operator-utils works with operator-sdk 0.18.x. We are working to enable operator sdk 1.x, you can follow progress here: https://github.com/redhat-cop/operator-utils/pull/41 We should be close to merging.

raffaelespazzoli commented 3 years ago

the operator sdk-1.3 compatible version of operator-utils has been merged, let me know if I can close this.