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
Only retain last state for condition types #715
Conversation
Condition types are expected to be singelton and only last state of a given condition type shoud be maintained. We currently maintain a list of all transitions to a state as a list with max of 10. This causes problems with condition check APIs. Currently support just one type, Valid. Fixes submariner-io#714 Signed-off-by: Vishal Thapar <5137689+vthapar@users.noreply.github.com>
|
🤖 Created branch: z_pr715/vthapar/unique-conditions |
| @@ -410,20 +408,14 @@ func (a *Controller) updateExportedServiceStatus(name, namespace string, status | |||
| Message: &msg, | |||
| } | |||
|
|
|||
| numCond := len(toUpdate.Status.Conditions) | |||
| if numCond > 0 && serviceExportConditionEqual(&toUpdate.Status.Conditions[numCond-1], &exportCondition) { | |||
| // TODO: Currently we only check for conditionType Valid. Revisit this when Conflict is supported. | |||
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.
To preserve the equivalent of the historical trace, we could add other condition types like "SyncedToBroker". But we can look into that later.
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.
We should, but we will have to propose these to MCS sig first.
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.
I wouldn't think so. The MCS API defines some common, general ones but I'd think an implementation should be able to define their own specific types - the MCS spec doesn't preclude that. Eg, the type "SyncedToBroker" would be specific to our implementation.
|
🤖 Closed branches: [z_pr715/vthapar/unique-conditions] |
|
@vthapar Do you agree this should be backported? Do you want to send it? |
Condition types are expected to be singelton and only last
state of a given condition type shoud be maintained. We currently
maintain a list of all transitions to a state as a list with max of
10. This causes problems with condition check APIs. Currently
support just one type, Valid.
Fixes #714
Signed-off-by: Vishal Thapar 5137689+vthapar@users.noreply.github.com