nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
107 stars 53 forks source link

nephio-operator docker build is failing #254

Closed johnbelamaric closed 1 year ago

johnbelamaric commented 1 year ago

https://prow.nephio.io/view/gs/prow-nephio-sig-release/logs/build-push-image-nephio-operator-commit-conf/1664510205079064576

Even after I update the Dockerfile to use go 1.20, I get this error:

[hi on] jbelamaric@jbelamaric:~/proj/gh/johnbelamaric/nephio/operators/nephio-controller-manager$ make docker-build
go test ./... -v -coverprofile lcov.info 
# github.com/nephio-project/nephio/controllers/pkg/resource
../../../../../../go/pkg/mod/github.com/nephio-project/nephio/controllers/pkg@v0.0.0-20230530181407-a74ad096acc7/resource/fake.go:27:23: cannot use &MockClient{} (value of type *MockClient) as client.Client value in variable declaration: *MockClient does not implement client.Client (missing method GroupVersionKindFor)
# sigs.k8s.io/cluster-api/api/v1beta1
../../../../../../go/pkg/mod/sigs.k8s.io/cluster-api@v1.4.2/api/v1beta1/machine_webhook.go:45:27: cannot use &Machine{} (value of type *Machine) as admission.Validator value in variable declaration: *Machine does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../../../../go/pkg/mod/sigs.k8s.io/cluster-api@v1.4.2/api/v1beta1/machinedeployment_webhook.go:56:27: cannot use &MachineDeployment{} (value of type *MachineDeployment) as admission.Validator value in variable declaration: *MachineDeployment does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../../../../go/pkg/mod/sigs.k8s.io/cluster-api@v1.4.2/api/v1beta1/machinedeployment_webhook.go:61:16: assignment mismatch: 2 variables but admission.NewDecoder returns 1 value
../../../../../../go/pkg/mod/sigs.k8s.io/cluster-api@v1.4.2/api/v1beta1/machinehealthcheck_webhook.go:63:27: cannot use &MachineHealthCheck{} (value of type *MachineHealthCheck) as admission.Validator value in variable declaration: *MachineHealthCheck does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../../../../go/pkg/mod/sigs.k8s.io/cluster-api@v1.4.2/api/v1beta1/machineset_webhook.go:45:27: cannot use &MachineSet{} (value of type *MachineSet) as admission.Validator value in variable declaration: *MachineSet does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
FAIL
make: *** [../../default-go-test.mk:31: test] Error 1

@henderiw I seem to recall seeing some errors like this wrt the controller-runtime update?

johnbelamaric commented 1 year ago

https://github.com/kubernetes-sigs/cluster-api/pull/8007

johnbelamaric commented 1 year ago

So, I think we just have to not use a pinned release of cluster-api here. Trying it.

johnbelamaric commented 1 year ago

Ok, so, yeah, the pkg go.mod has a different cluster-api version that works. But somehow that pkg version is still not what's importing to this build. I really think we have to do something different here, as discussed in https://github.com/nephio-project/nephio/pull/253#issue-1737450330 - merging that PR didn't fix this the way I thought it would.

So...for now I manually built and pushed a new operator image.

henderiw commented 1 year ago

we need to update the controllers/pkg version I believe

johnbelamaric commented 1 year ago

This is fixed