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

Essential checks introduction for hooks and groups in recipe #1795

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/controller/kubeobjects/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ type KubeResourcesSpec struct {

//+optional
IsHook bool `json:"isHook,omitempty"`

//+optional
GroupEssential *bool `json:"essential,omitempty"`
}

// HookSpec provides spec of either check or exec hook that needs to be executed
Expand Down
13 changes: 11 additions & 2 deletions internal/controller/volumereplicationgroup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ func (v *VRGInstance) reconcileAsSecondary() ctrl.Result {

if vrg.Spec.Action == ramendrv1alpha1.VRGActionRelocate {
// TODO: If RDSpec changes, and hence generation changes, a k8s backup would be initiated again as Secondary
v.relocate(&result)
v.relocate(&result, true)
}

// Clear the conditions only if there are no more work as secondary and the RDSpec is not empty.
Expand All @@ -1390,7 +1390,16 @@ func (v *VRGInstance) reconcileAsSecondary() ctrl.Result {
return result
}

func (v *VRGInstance) relocate(result *ctrl.Result) {
func (v *VRGInstance) relocate(result *ctrl.Result, returnEarly bool) {
// We already have the vrg.spec.state set to Secondary, so the user has been
// asked to cleanup the resources and we cannot upload the kube resources
// here. This final sync of kube resources should happen before the user is
// asked to cleanup the resources. This bug will be fixed in the future
// after we reconcile the volsync and volrep processes to be similar.
if returnEarly {
return
}

vrg := v.instance

if clusterDataProtected := meta.FindStatusCondition(vrg.Status.Conditions,
Expand Down
Loading