You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check whether the gatewayclasses, gateways, and istios CRDs actually
exist before adding them to relatedObjects.
Watch customresourcedefinitions in the status controller so that it
updates relatedObjects as these CRDs are created.
Check the "GatewayAPIController" featuregate to determine whether to add
the gatewayclasses, gateways, istios, and subscriptions resources to
relatedObjects, in addition to checking the "GatewayAPI" featuregate.
Before this change, the operator could add istios to relatedObjects even
if the OSSM subscription failed to install. By convention, an operator
should only add resources to relatedObjects if those resources exist.
This commit fixes OCPBUGS-54745.
https://issues.redhat.com/browse/OCPBUGS-54745
* pkg/operator/controller/status/controller.go
(gatewaysResourceName, gatewayclassesResourceName, istiosResourceName):
New consts for the CRD names.
(relatedObjectsCRDs): New var for a string set that contains
gatewaysResourceName, gatewayclassesResourceName, and
istiosResourceName.
(New): Check the GatewayAPIControllerEnabled field in the controller
config in addition to checking GatewayAPIEnabled to determine whether to
watch subscriptions and customresourcedefinitions. Add a watch on
customresourcedefinitions, with a predicate for CRDs with names that are
in relatedObjectsCRDs.
(Config): Add GatewayAPIControllerEnabled.
(Reconcile): Check the GatewayAPIControllerEnabled field in the
controller config as well as the haveIstiosResource,
haveGatewayclassesResource, and haveGatewaysResource fields in the
operatorState object, and conditionally add the corresponding resources
to relatedObjects.
(operatorState): Add haveIstiosResource, haveGatewaysResource, and
haveGatewayclassesResource fields.
(getOperatorState): Check GatewayAPIControllerEnabled in addition to
GatewayAPIEnabled before checking for the OSSM subscription. Set
haveGatewaysResource, haveGatewayclassesResource, and
haveIstiosResource.
* pkg/operator/operator.go (New): Specify GatewayAPIControllerEnabled in
the status controller config.
* test/e2e/operator_test.go (TestClusterOperatorStatusRelatedObjects):
Expect to see "gateways" and "gatewayclasses" in relatedObjects if the
"GatewayAPI" and "GatewayAPIController" featuregates are enabled.
0 commit comments