fix: copy all labels from node-agent to hosting pods for PVB/PVR #9436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9435
Problem
In v1.17.0, Velero introduced a micro-service architecture where pod volume backups/restores run in separate hosting pods instead of directly in node-agent pods. The hosting pods only inherited labels from a hardcoded whitelist (
util.ThirdPartyLabels), which caused issues when clusters require additional labels (e.g., proxy labels for mutating webhooks).Solution
GetAllLabelsFromNodeAgent()function inpkg/nodeagent/node_agent.gothat copies all labels from the node-agent DaemonSetpod_volume_backup_controller.goandpod_volume_restore_controller.goto use the new functionChanges
GetAllLabelsFromNodeAgent()function that retrieves all labels from node-agent DaemonSetsetupExposeParam()to useGetAllLabelsFromNodeAgent()instead of only copying whitelisted labelssetupExposeParam()to useGetAllLabelsFromNodeAgent()instead of only copying whitelisted labelsTesting
util.ThirdPartyLabelsas fallback if DaemonSet lookup failsImpact
This fix ensures that hosting pods inherit all necessary labels from node-agent, enabling:
Thank you for contributing to Velero!
Please add a summary of your change
Does your change fix a particular issue?
Fixes #(issue)
Please indicate you've done the following:
make new-changelog) or comment/kind changelog-not-requiredon this PR.site/content/docs/main.