-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mirror order conditions as False, Unknown, True #204
Mirror order conditions as False, Unknown, True #204
Conversation
The lib-common PR openstack-k8s-operators/lib-common#204 fixed the behavior of Conditions.Mirror(). So this patch checks if the fix needs any adaptation from nova-operator.
/hold |
The lib-common PR openstack-k8s-operators/lib-common#204 fixed the behavior of Conditions.Mirror(). So it now returns any Unknown condition before any True condition (except ReadyCondition True). It seems that our tests incorrectly assumed that NovaAPI becomes Ready after the StatefulSet is Ready. But in reality NovaAPI creates the KeystoneEndpoint *after* the StatefulSet is ready. So these tests passed only because of the original bug in the Mirror code returned a True condition from NovaAPI when it had DeploymentReady=True and KeystoneEndpointReady=Unknown status. As the bug is fixed now the test needs to make sure the KeystoneEndpoints are ready before it can expect that NovaAPI is ready.
/unhold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, as we discussed on slack, just two comments on the tests
This is a breaking change on Conditions.Mirror(). Originally this call ordered conditions as False, True, Unknown then picked the first of that list to reflect. However all the use cases (we see) assume that if there is reasourceA that depends on the status of resourceB then resourceA reconciler calls: resourceB.Status.Mirror(ResourceBSpecificSubConditionOfA) and expects that the call returns the most sever non True condition if any or return a True condition otherwise. So the original behavior that returned True even if there was Unknown condition was unexpected. This patch changes the order of the status to False, Unknown, True. But keeps the original logic that if the ReadyCondition is True then the rest of the conditions are ignored even if there are False conditions in the list.
9ba5716
to
3c60f35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
The lib-common PR openstack-k8s-operators/lib-common#204 fixed the behavior of Conditions.Mirror(). So it now returns any Unknown condition before any True condition (except ReadyCondition True). It seems that our tests incorrectly assumed that NovaAPI becomes Ready after the StatefulSet is Ready. But in reality NovaAPI creates the KeystoneEndpoint *after* the StatefulSet is ready. So these tests passed only because of the original bug in the Mirror code returned a True condition from NovaAPI when it had DeploymentReady=True and KeystoneEndpointReady=Unknown status. As the bug is fixed now the test needs to make sure the KeystoneEndpoints are ready before it can expect that NovaAPI is ready.
This is a breaking change on Conditions.Mirror(). Originally this call ordered conditions as False, True, Unknown then picked the first of that list to reflect. However all the use cases (we see) assume that if there is reasourceA that depends on the status of resourceB then resourceA reconciler calls:
and expects that the call returns the most sever non True condition if any or return a True condition otherwise. So the original behavior that returned True even if there was Unknown condition was unexpected.
This patch changes the order of the status to False, Unknown, True. But keeps the original logic that if the ReadyCondition is True then the rest of the conditions are ignored even if there are False conditions in the list.