Skip to content

OCPBUGS-77160: Add NMStateConfig to BareMetal backup#185

Open
michalskrivanek wants to merge 1 commit intoopenshift:mainfrom
michalskrivanek:OCPBUGS-77160
Open

OCPBUGS-77160: Add NMStateConfig to BareMetal backup#185
michalskrivanek wants to merge 1 commit intoopenshift:mainfrom
michalskrivanek:OCPBUGS-77160

Conversation

@michalskrivanek
Copy link

@michalskrivanek michalskrivanek commented Feb 23, 2026

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • New Features

    • Backups now include network state and infrastructure environment resources so snapshots capture network configurations and infra environment metadata.
  • Documentation

    • Updated BareMetal example backup configurations to reflect inclusion of network state and infra environment resources for more complete backups.

@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 23, 2026
@openshift-ci-robot
Copy link

@michalskrivanek: This pull request references Jira Issue OCPBUGS-77160, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

Walkthrough

Added nmstateconfig to the includedResources list in two BareMetal backup YAMLs and extended the exported BackupAgentResources list in pkg/core/types/types.go to include nmstateconfigs, nmstateconfig, infraenvs, and infraenv.

Changes

Cohort / File(s) Summary
BareMetal Backup Configurations
examples/BareMetal/03-backup-bm-csi-compatible.yaml, examples/BareMetal/03-backup-bm-csi-no-compatible.yaml
Added nmstateconfig to the spec.includedResources list in both backup example manifests.
Core Types
pkg/core/types/types.go
Appended resource identifiers to the exported BackupAgentResources slice: added nmstateconfigs, nmstateconfig, infraenvs, and infraenv.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed PR modifies configuration and type declarations only; no test code is introduced or modified.
Test Structure And Quality ✅ Passed The custom check for 'Test Structure and Quality' is not applicable to this PR as it only modifies YAML files and one Go source file with no test code changes.
Title check ✅ Passed The title clearly identifies the main change: adding NMStateConfig to BareMetal backup examples, matching the primary objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot requested review from devguyio and enxebre February 23, 2026 13:41
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 23, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 23, 2026

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

@jparrill
Copy link
Contributor

jparrill commented Mar 3, 2026

please rebase with the latest changes. The PR needs them in order to pass Konflux pipelines.

@jparrill
Copy link
Contributor

jparrill commented Mar 3, 2026

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 3, 2026
Copy link
Contributor

@jparrill jparrill left a comment

Choose a reason for hiding this comment

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

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.

@michalskrivanek
Copy link
Author

@jparrill I think it's only BareMetal via InfraEnv. But it doesn't hurt as "common" either I guess

@michalskrivanek
Copy link
Author

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>
@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: michalskrivanek
Once this PR has been reviewed and has the lgtm label, please ask for approval from jparrill. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 3, 2026
@openshift-ci-robot
Copy link

@michalskrivanek: This pull request references Jira Issue OCPBUGS-77160, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (yli2@redhat.com), skipping review request.

Details

In response to this:

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • New Features

  • Backups now include network state and infrastructure environment resources so snapshots capture network configurations and infra environment metadata.

  • Documentation

  • Updated BareMetal example backup configurations to reflect inclusion of network state and infra environment resources for more complete backups.

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.

@michalskrivanek
Copy link
Author

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 michalskrivanek changed the title OCPBUGS-77160: Add NMStateConfig to BareMetal backup examples OCPBUGS-77160: Add NMStateConfig to BareMetal backup Mar 3, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

@michalskrivanek: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants