-
Epic
-
Resolution: Done
-
Blocker
-
None
-
None
-
None
-
Controller-runtime 0.16 update
-
False
-
-
False
-
Committed
-
No Docs Impact
-
To Do
-
RHOSSTRAT-270 - Red Hat OpenStack 18.0 Greenfield Deployment
-
Committed
-
No impact
-
0% To Do, 0% In Progress, 100% Done
-
Automated
-
-
-
2024Q1
Description
Issues introduce by k8s.io/* v0.27.x mean there are broken interfaces with controller-runtime as outlined here:
https://github.com/kubernetes-sigs/controller-runtime/pull/2223
This has since been fixed, but to upgrade controller-runtime, we have several methods within our operators that need to be updated.
- Webhooks must change their method signatures on:
ValidateCreate() ValidateUpdate() ValidateDelete()
These signatures now need to include `admission.Warnings` in the return values:
https://github.com/kubernetes-sigs/controller-runtime/commit/8770b4d3b5425b156f48c971ee140ea25f9c1bfa#diff-0b6c79b3483fe5ad476ea26192f2d8bfe05a44688209721b626dc793204df28eR42
- The Watches() implementation has also been changed. This no longer accepts a source.Kind as the first argument. Instead, we should use a client.Object as the first argument:
https://github.com/kubernetes-sigs/controller-runtime/blob/release-0.15/pkg/builder/controller.go#L137
Given the dependencies between each of the Operators, it appears all will hinge on MariaDB and Keystone being updated first. These PR's already exist:
https://github.com/openstack-k8s-operators/mariadb-operator/pull/110
https://github.com/openstack-k8s-operators/keystone-operator/pull/252
Until then, the other operators will fail with the following complaints about the Validate*() interfaces:
❯ go vet ./...# github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1../../../go/pkg/mod/github.com/openstack-k8s-operators/mariadb-operator/api@v0.0.0-20230517052836-8478be8b3aaa/v1beta1/galera_webhook.go:57:27: cannot use &Galera{} (value of type *Galera) as admission.Validator value in variable declaration: *Galera does not implement admission.Validator (wrong type for method ValidateCreate) have ValidateCreate() error want ValidateCreate() (admission.Warnings, error)../../../go/pkg/mod/github.com/openstack-k8s-operators/mariadb-operator/api@v0.0.0-20230517052836-8478be8b3aaa/v1beta1/mariadb_webhook.go:70:27: cannot use &MariaDB{} (value of type *MariaDB) as admission.Validator value in variable declaration: *MariaDB does not implement admission.Validator (wrong type for method ValidateCreate) have ValidateCreate() error want ValidateCreate() (admission.Warnings, error)# github.com/openstack-k8s-operators/keystone-operator/api/v1beta1../../../go/pkg/mod/github.com/openstack-k8s-operators/keystone-operator/api@v0.0.0-20230519193353-09694c267b18/v1beta1/keystoneapi_webhook.go:76:27: cannot use &KeystoneAPI{} (value of type *KeystoneAPI) as admission.Validator value in variable declaration: *KeystoneAPI does not implement admission.Validator (wrong type for method ValidateCreate) have ValidateCreate() error want ValidateCreate() (admission.Warnings, error)
References:
There are several breaking changes in v0.15.0:
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0
And v0.16.0:
https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.16.0
Resolution steps
1. We need to update the web hooks to comply with the new interface definition:
https://github.com/kubernetes-sigs/controller-runtime/blob/main/pkg/webhook/admission/validator.go#L33-L53
2. We need to initialise the manager with the new structs:
https://github.com/kubernetes-sigs/controller-runtime/pull/2407/files
3. The webhook needs to be initialised following the new format:
https://github.com/kubernetes-sigs/controller-runtime/pull/2422/files
I have captured some rudimentary examples of what is required in the following 3 commits:
https://github.com/openstack-k8s-operators/heat-operator/pull/127
- blocks
-
OSPRH-3745 RabbitMQ does not start in IPv6 single-stack environment
-
- Closed
-
-
OSPRH-3997 Update MetricStorage for new OBO features
-
- Closed
-
- is depended on by
-
OSPRH-3862 [QE HardProv] DFG has smoke/critical jobs created in the Component (not necessarily passing) - documenting work that’s left to be done
-
- Closed
-
- links to
1.
|
Update operators to use controller-runtime 0.16 |
|
Closed | |
Unassigned |