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

drpc: set ProgressionWaitOnUserToCleanUp for both volsync and volrep #1520

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 14 additions & 12 deletions internal/controller/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -1732,16 +1732,16 @@
d.log.Info(fmt.Sprintf("PeerReady Condition is %s, msg: %s", condition.Status, condition.Message))

// IFF we have VolSync PVCs, then no need to clean up
homeCluster := clusterToSkip
// homeCluster := clusterToSkip

repReq, err := d.IsVolSyncReplicationRequired(homeCluster)
if err != nil {
return fmt.Errorf("failed to check if VolSync replication is required (%w)", err)
}
//repReq, err := d.IsVolSyncReplicationRequired(homeCluster)

Check failure on line 1737 in internal/controller/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

commentFormatting: put a space between `//` and comment text (gocritic)
//if err != nil {
// return fmt.Errorf("failed to check if VolSync replication is required (%w)", err)
//}

if repReq {
return d.cleanupForVolSync(clusterToSkip)
}
//if repReq {

Check failure on line 1742 in internal/controller/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

commentFormatting: put a space between `//` and comment text (gocritic)
// return d.cleanupForVolSync(clusterToSkip)
//}

clean, err := d.cleanupSecondaries(clusterToSkip)
if err != nil {
Expand All @@ -1766,7 +1766,7 @@
}

//nolint:gocognit
func (d *DRPCInstance) cleanupForVolSync(clusterToSkip string) error {

Check failure on line 1769 in internal/controller/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint (.)

func `(*DRPCInstance).cleanupForVolSync` is unused (unused)
d.log.Info("VolSync needs both VRGs. No need to clean up secondary")
d.log.Info("Ensure secondary on peer")

Expand Down Expand Up @@ -1851,10 +1851,6 @@

d.log.Info("Request not complete yet", "cluster", clusterName)

if d.instance.Spec.ProtectedNamespaces != nil && len(*d.instance.Spec.ProtectedNamespaces) > 0 {
d.setProgression(rmn.ProgressionWaitOnUserToCleanUp)
}

// IF we get here, either the VRG has not transitioned to secondary (yet) or delete didn't succeed. In either cases,
// we need to make sure that the VRG object is deleted. IOW, we still have to wait
return !done, nil
Expand Down Expand Up @@ -1916,6 +1912,12 @@
return false
}

// If the VRG is secondary everywhere, then we need to wait for the cleanup
// to be done by the user in case of discovered apps
if d.instance.Spec.ProtectedNamespaces != nil && len(*d.instance.Spec.ProtectedNamespaces) > 0 {
d.setProgression(rmn.ProgressionWaitOnUserToCleanUp)
}

return true
}

Expand Down
Loading