cockroach-operator
cockroach-operator copied to clipboard
Upgrade dependencies to match controller-runtime v0.9.0
if I try to import crdb v1alpha1 into my project and build against k8s 1.21 I get go mod errors:
in the cockroach go.mod I see this:
k8s.io/client-go v9.0.0+incompatible
is it possible to upgrade this to v0.21.1?
@jmccormick2001 we are pinning the version of k8s client to the version that controller-runtime uses 0.21.1 in controller-runtime v0.9.0. So we need to upgrade multiple things. Also the last line of the go.mod overrides the k8s.io/client-go v9.0.0+incompatible line.
See
https://github.com/cockroachdb/cockroach-operator/blob/db8758aab44c83908741e0b9d1a380aa9da4c36c/go.mod#L38
We would need to update:
- go.mod to correct versions matching go.mod in controller-runtime v0.9.0. All dependencies to match 0.21.1 and the controller-runtime deps.
- run the bazel target to update the bazel deps
Also @keith-mcclellan we need to talk about which k8s client we are going to run with our OpenShift support. What version of OpenShift of the k8s client is supported by OpenShift? We should not run +2 versions ahead of OpenShift or we can start running into problems.
https://github.com/cockroachdb/cockroach-operator/blob/master/bundle/manifests/crdb.cockroachlabs.com_crdbclusters.yaml#L14 I'm sure you are already thinking about it, but the CRD needs to go to v1 apiVersion to support k8s1.22 and OCP 4.9.
@jmccormick2001 we do not have an issue open for that and bumping controller-runtime should fix that. When is 4.9 out?
@chrislovecnm we need to regenerate also the bundle format used for dev so we can update to latest crd that uses v1 apiVersion, or to remove this folder and use only the one from https://github.com/cockroachdb/cockroach-operator/blob/master/deploy/certified-metadata-bundle/...
To generate the latest bundle please run:
make gen-csv
@udnay we probably need to discuss this
@jmccormick2001 we do not have an issue open for that and bumping controller-runtime should fix that. When is 4.9 out?
you have a few months I'd estimate, but we are encouraging operator authors to migrate now to avoid upgrade issues when 4.9 does come out. v1 CRDs work with OCP 4.8 so you are in a better place if you have already done the migration going into k8s1.22/ocp 4.9. Its important to note the other deprecated APIs as well, as its more than just CRD versions. I've not looked at your operator code but any kube resource that you are creating at runtime that is v1beta1 I'd take a close look at.