VictoriaMetrics / operator

Kubernetes operator for Victoria Metrics
Apache License 2.0
422 stars 140 forks source link

Update sigs.k8s.io/controller-runtime dependency #859

Closed recharte closed 6 months ago

recharte commented 7 months ago

Problem

At the current state, the controller-runtime dependency is pinned to v0.13.1. This version is over 1 year old at this point and the latest release is v0.17.0.

As an operator developer, I'd like to integrate with the VictoriaMetrics Operator and be able to create (among others) VMAgent CRs. I'm currently using kubernetes-sigs/controller-runtime@v0.17.0 and since several breaking changes have been introduced since v0.13.1 I get the following errors when importing github.com/VictoriaMetrics/operator/api:

# github.com/VictoriaMetrics/operator/api/victoriametrics/v1beta1
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmagent_webhook.go:26:27: cannot use &VMAgent{} (value of type *VMAgent) as admission.Validator value in variable declaration: *VMAgent does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmalert_webhook.go:23:27: cannot use &VMAlert{} (value of type *VMAlert) as admission.Validator value in variable declaration: *VMAlert does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmalertmanager_webhook.go:22:27: cannot use &VMAlertmanager{} (value of type *VMAlertmanager) as admission.Validator value in variable declaration: *VMAlertmanager does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmalertmanagerconfig_webhook.go:47:27: cannot use &VMAlertmanagerConfig{} (value of type *VMAlertmanagerConfig) as admission.Validator value in variable declaration: *VMAlertmanagerConfig does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmauth_webhook.go:39:27: cannot use &VMAuth{} (value of type *VMAuth) as admission.Validator value in variable declaration: *VMAuth does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmcluster_webhook.go:22:27: cannot use &VMCluster{} (value of type *VMCluster) as admission.Validator value in variable declaration: *VMCluster does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmrule_webhook.go:24:27: cannot use &VMRule{} (value of type *VMRule) as admission.Validator value in variable declaration: *VMRule does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmsingle_webhook.go:22:27: cannot use &VMSingle{} (value of type *VMSingle) as admission.Validator value in variable declaration: *VMSingle does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)
../../../go/pkg/mod/github.com/!victoria!metrics/operator/api@v0.0.0-20240126090615-0628def2e282/victoriametrics/v1beta1/vmuser_webhook.go:44:27: cannot use &VMUser{} (value of type *VMUser) as admission.Validator value in variable declaration: *VMUser does not implement admission.Validator (wrong type for method ValidateCreate)
        have ValidateCreate() error
        want ValidateCreate() (admission.Warnings, error)

Proposed solution

Update kubernetes-sigs/controller-runtime dependency to v0.17.0

f41gh7 commented 6 months ago

Must be fixed at v0.42.0 release