Skip to content
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

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

raghavendra-talur
Copy link
Member

@raghavendra-talur raghavendra-talur commented Jan 22, 2025

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.

@@ -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"
Copy link
Member

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"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

@raghavendra-talur raghavendra-talur marked this pull request as ready for review January 29, 2025 19:47
@raghavendra-talur raghavendra-talur force-pushed the rtalur-pv-k8s-sequence branch 4 times, most recently from 3bb6a43 to 9dd9b60 Compare January 30, 2025 18:35
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]>
@raghavendra-talur raghavendra-talur changed the title pv k8s sequence vrg: Add Kube object restore condition Jan 30, 2025
@raghavendra-talur
Copy link
Member Author

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)
Copy link
Member

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 {
Copy link
Member

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.

@BenamarMk BenamarMk merged commit f1926ba into RamenDR:main Jan 31, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants