-
Notifications
You must be signed in to change notification settings - Fork 58
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
vrg: Add Kube object restore condition #1758
vrg: Add Kube object restore condition #1758
Conversation
internal/controller/status.go
Outdated
@@ -30,6 +30,10 @@ const ( | |||
// after this condition is true. | |||
VRGConditionTypeClusterDataReady = "ClusterDataReady" | |||
|
|||
// K8s objects are ready. This condition is used to indicate that all the | |||
// K8s objects required for the app to be active in the cluster are ready. | |||
VRGConditionTypeK8sObjectsReady = "K8sObjectsReady" |
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.
So you want to add a new condition to show the status of the kube objects in addition of the pvcs/pvs restored by ramen?
It makes sense for #1729 but K8sObjectsReady does not match the terms we use. How about "KubeObjectsReady" matching "KubeObjectsSelector"?
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.
Done, thanks!
18d738b
to
90f57cd
Compare
3bb6a43
to
9dd9b60
Compare
Earlier, we used to restore kube objects along with PV and PVCs. However, with the introduction of hooks this is not correct. The hooks depend on the successful restoration of the PV and PVCs to succeed. There is a strict dependency in the order of operations and both cannot be performed in the same function call. We introduce a new condition to keep track of the restore status for Kube Objects. Once the pv and pvcs are restored then we proceed to the kube objects restoration. Co-Authored-by: Annaraya Narasagond <[email protected]> Signed-off-by: Raghavendra Talur <[email protected]>
9dd9b60
to
4eddb95
Compare
Fixes #1729 |
@@ -1224,6 +1242,28 @@ func (v *VRGInstance) shouldRestoreClusterData() bool { | |||
return true | |||
} | |||
|
|||
func (v *VRGInstance) shouldRestoreKubeObjects() bool { | |||
KubeObjectsRestored := findCondition(v.instance.Status.Conditions, VRGConditionTypeKubeObjectsReady) |
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.
Should KubeObjectsRestored be renamed as kubeObjectsRestoredCond?
func (v *VRGInstance) kubeObjectsRecover(result *ctrl.Result, s3ProfileName string) error { | ||
if v.kubeObjectProtectionDisabled("recovery") { | ||
return nil | ||
func (v *VRGInstance) skipIfS3ProfileIsForTest() bool { |
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.
(nit) this function shouldn't belong in this file.
Earlier, we used to restore kube objects along with PV and PVCs.
However, with the introduction of hooks this is not correct. The hooks depend on the successful restoration of the PV and PVCs to succeed. There is a strict dependency in the order of operations and both cannot be performed in the same function call.
We introduce a new condition to keep track of the restore status for Kube Objects. Once the pv and pvcs are restored then we proceed to the kube objects restoration.