OCPBUGS-77160: Add NMStateConfig to BareMetal backup#185
OCPBUGS-77160: Add NMStateConfig to BareMetal backup#185michalskrivanek wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@michalskrivanek: This pull request references Jira Issue OCPBUGS-77160, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughAdded Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @michalskrivanek. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
please rebase with the latest changes. The PR needs them in order to pass Konflux pipelines. |
|
/ok-to-test |
jparrill
left a comment
There was a problem hiding this comment.
Thanks for the contribution @michalskrivanek! Adding nmstateconfig to the examples is a good start, but this PR is incomplete — the plugin code itself also needs updating for NMStateConfig to actually work during backup/restore operations.
Missing code changes
1. pkg/core/types/types.go — Resource lists
The RestorePlugin.AppliesTo() method in pkg/core/restore.go (lines 109-121) returns a ResourceSelector built by concatenating the resource lists defined in pkg/core/types/types.go. If nmstateconfig is not present in any of these lists, Velero will not invoke the plugin for NMStateConfig resources during restore.
You need to add "nmstateconfigs", "nmstateconfig" to the appropriate list:
BackupCommonResources— if it should apply to all providers (recommended, since NMStateConfig can be used across platforms)BackupAgentResources— if it should only apply to Agent/BareMetal
2. Examples only cover BareMetal
The Jira issue mentions BareMetal specifically, but NMStateConfig resources can be relevant for other providers as well. Consider adding nmstateconfig to the backup examples for other platforms too, or at least documenting why it's BareMetal-only.
3. InfraEnv has the same gap
While reviewing this, I noticed that infraenv appears in the example YAML files as an included resource, but it is also not present in any of the Go resource lists in pkg/core/types/types.go (BackupCommonResources, BackupAgentResources, etc.). This means the RestorePlugin won't process InfraEnv resources during restore either. This is a pre-existing issue but worth fixing in the same PR.
Summary: Without updating pkg/core/types/types.go, the examples will include NMStateConfig in the Velero backup, but the restore plugin won't process them. Please add the resource to the appropriate list(s) in the Go code.
|
@jparrill I think it's only BareMetal via InfraEnv. But it doesn't hurt as "common" either I guess |
|
or...since you have dedicated list per provider...and "Agent" is s in infraenv only...up to you, but logically it makes sense to me to keep it together, i.e. just add to BackupAgentResources. It's tied to InfraEnv CR (the assisted installer iso content is composed from both infraenv and nmstateconfig CRs) |
also add missing InfraEnv. These are relevant only for Agent platform (processed by Assisted Service). Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com>
6a200bb to
7ca9e5b
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: michalskrivanek The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@michalskrivanek: This pull request references Jira Issue OCPBUGS-77160, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (yli2@redhat.com), skipping review request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
updated. AFAICT the types.go update is only relevant for velero to pass these to the plugin, correct? In my observation the resources were backed up and restored all right, this plugin currently doesn't really touch those. |
|
@michalskrivanek: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
complete the examples
Signed-off-by: Michal Skrivanek michal.skrivanek@redhat.com
What this PR does / why we need it
add missing NMStateConfig resource to BareMetal examples
Which issue(s) this PR fixes
Fixes https://issues.redhat.com/browse/OCPBUGS-77160
Checklist
Summary by CodeRabbit
New Features
Documentation