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

Volumes in recipes should be used to override LabelSelector and ignored for velero backups #1739

Merged

Conversation

raghavendra-talur
Copy link
Member

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

  • Removed function pointer that changed behavior of the recipeVolumesAndOptionallyWorkflowsGet()
  • RecipeElementsGet always returns complete recipe data
  • Ignore volume group in a workflow sequence
  • Fix tests

@@ -141,15 +132,19 @@ func recipeVolumesAndOptionallyWorkflowsGet(ctx context.Context, reader client.R
recipe.Spec.Volumes.LabelSelector)
}

*recipeElements = RecipeElements{
recipeElements = RecipeElements{
Copy link
Member

Choose a reason for hiding this comment

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

Should pvcSelector be added with a OR logic between selector defined in drpc and recipe?

Copy link
Member Author

Choose a reason for hiding this comment

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

The expectation is that recipe overrides everything that is defined in the drpc.

raghavendra-talur and others added 3 commits January 8, 2025 13:20
Co-Authored-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Raghavendra Talur <[email protected]>
Co-Authored-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Raghavendra Talur <[email protected]>
Co-Authored-by: Annaraya Narasagond <[email protected]>
Signed-off-by: Raghavendra Talur <[email protected]>
@raghavendra-talur raghavendra-talur force-pushed the rtalur-fix-volumes-in-recipes branch from 15251f0 to 176e120 Compare January 8, 2025 18:20
@raghavendra-talur raghavendra-talur changed the title Refactor RecipeElementsGet Volumes in recipes should be used to override LabelSelector and ignored for velero backups Jan 9, 2025
var recipeElements RecipeElements
recipeElements, err := RecipeElementsGet(ctx, reader, vrg, ramenConfig, log)
if err != nil {
return recipeElements.PvcSelector, err
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 line is a bit confusing. It references returning recipeElements.PvcSelector on an error, but since filterPVC() skips PvcSelector in case of an error, I suggest returning PvcSelector{} instead. This would improve readability.

Copy link
Member Author

Choose a reason for hiding this comment

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

I merged this PR and fixed this nit in the next PR #1738

@raghavendra-talur raghavendra-talur merged commit c4d7b33 into RamenDR:main Jan 10, 2025
23 checks passed
@raghavendra-talur raghavendra-talur deleted the rtalur-fix-volumes-in-recipes branch January 10, 2025 15:13
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.

3 participants