Add Configured condition to all controllers#426
Conversation
| Type: v1alpha1.ReadyCondition, | ||
| Type: v1alpha1.ConfiguredCondition, |
There was a problem hiding this comment.
@nikatza I'm not sure if this is entirely correct and I'd like to discuss it with you. It seems like we should set both conditions here, not just replace the Ready condition with Configured condition. Same goes for the other files where this was done.
There was a problem hiding this comment.
I think this is correct with only setting the "Configured" Condition. The reconcileVRF func is called by reconcile. If the former sets the "Configured" condition, the later still calls RecomputeReady in it's defer call when returning. So the Ready condition would be set according on the "Configured" condition, which is what we want.
There was a problem hiding this comment.
Yes that seems to be right. We set the Configured condition explicitly here and setting the Ready condition is taken care off by the deferred call to conditions.RecomputeReady().
felix-kaestner
left a comment
There was a problem hiding this comment.
As we are adding a new condition to these resources, should we also add a printcolumn like so?
diff --git a/api/core/v1alpha1/acl_types.go b/api/core/v1alpha1/acl_types.go
index 6501f362..a7a01b70 100644
--- a/api/core/v1alpha1/acl_types.go
+++ b/api/core/v1alpha1/acl_types.go
@@ -122,6 +122,7 @@ type AccessControlListStatus struct {
// +kubebuilder:printcolumn:name="Device",type=string,JSONPath=`.spec.deviceRef.name`
// +kubebuilder:printcolumn:name="Entries",type=string,JSONPath=`.status.entriesSummary`,priority=1
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
+// +kubebuilder:printcolumn:name="Configured",type=string,JSONPath=`.status.conditions[?(@.type=="Configured")].status`,priority=1
// +kubebuilder:printcolumn:name="Paused",type=string,JSONPath=`.status.conditions[?(@.type=="Paused")].status`,priority=1
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
65211b0 to
4b9f4ad
Compare
Signed-off-by: Adam Trizuljak <adam.trizuljak@sap.com>
https://github.wdf.sap.corp/sap-cloud-infrastructure/neutron-issues/issues/361
ConfiguredConditionconditions.RecomputeReady()to ensure the Ready condition is evaluated and set at the end of the reconcile loopcond := conditions.FromError(err)already returns the Configured condition, so we just remove the next line that was overriding it with the Ready conditionTodo
ReadyConditiontoConfiguredCondition- I suspect both conditions should be set