[oadp-1.5] Fix VolumeGroupSnapshotLabelKey test panic#359
Conversation
…BackupSpecEnforcedFields Remove VolumeGroupSnapshotLabelKey test case that references a BackupSpec field not present in the openshift/velero v1.16.x fork used by oadp-1.5. The field was added upstream in v1.17.0+ (velero-io/velero#8938), causing a reflect panic at runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
⛔ Snyk checks have failed. 6 issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Update openshift/velero replace directive to match oadp-operator oadp-1.5 branch (d673230b813e). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
this will unblock #355 CI failure |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Joeavaikath, shubham-pampattiwar The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
For the Golang check, you need to update the GHA workflow. |
Summary
Remove the
VolumeGroupSnapshotLabelKeytest case fromTestValidateBackupSpecEnforcedFieldsthat panics at runtime withreflect: call of reflect.Value.Set on zero Value.Background
The
VolumeGroupSnapshotLabelKeyfield was added to velero'sBackupSpecin upstream vmware-tanzu/velero#8938, first appearing in velero v1.17.0. The oadp-1.5 branch uses the openshift/velero v1.16.x fork, which does not carry this field.A test case referencing this field was introduced in #341 (commit aad3132, cherry-picked from #333). The test uses
reflect.ValueOf(...).Elem().FieldByName("VolumeGroupSnapshotLabelKey")to set the field on aBackupSpecstruct. Since the field doesn't exist in the v1.16.x fork,FieldByNamereturns a zeroreflect.Value, and calling.Set()on it panics.This was not caught at the time because CI did not trigger for the two most recent commits on oadp-1.5 (
01c7191on 2026-03-31 andaad3132on 2026-05-11). The panic first surfaced in PR #355 (the rebase-bot PR), which was the first CI run to exercise this code path.Test plan
go test ./internal/common/function/...passes (including theEnsure_all_backup_spec_fields_were_testedguard)