Skip to content

OSASINFRA-4468: add test for appendVolumeMetadata support in Cinder CSI - #318

Draft
chenwng wants to merge 1 commit into
openshift:mainfrom
chenwng:cinder-csi-metadata
Draft

OSASINFRA-4468: add test for appendVolumeMetadata support in Cinder CSI#318
chenwng wants to merge 1 commit into
openshift:mainfrom
chenwng:cinder-csi-metadata

Conversation

@chenwng

@chenwng chenwng commented Aug 24, 2026

Copy link
Copy Markdown

This PR adds an e2e test case for the support of appendVolumeMetadata in Cinder CSI. After the merge of kubernetes/cloud-provider-openstack#3162 and downstream sync, it will be avaiable on OCP version >= 5.1.0.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 24, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 24, 2026

Copy link
Copy Markdown

@chenwng: This pull request references OSASINFRA-4468 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.1.0" version, but no target version was set.

Details

In response to this:

This PR adds an e2e test case for the support of appendVolumeMetadata in Cinder CSI. After the merge of kubernetes/cloud-provider-openstack#3162 and downstream sync, it will be avaiable on OCP version >= 5.1.0.

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.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 24, 2026
@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign winiciusallan for approval. 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

o.Expect(err).Should(o.BeNil())

available, errs := constraint.Validate(latestVer)
o.Expect(len(errs)).Should(o.BeZero())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This fails the test on older clusters instead of skipping it. Constraints.Validate (vendored Masterminds/semver) returns available=false AND a non-empty errs whenever the version does not satisfy >=5.1.0-0. So on exactly the clusters we intend to skip, this assertion fails before the Skipf on line 343 is ever reached — the skip branch is unreachable.

Suggest gating on the boolean only and dropping the errs assertion:

if !constraint.Check(latestVer) {
e2eskipper.Skipf("appendVolumeMetadata is only available on >= 5.1.0")
}

errs is just the why-not detail, not an error condition to assert against.


o.Expect(len(cv.Status.History)).ShouldNot(o.BeZero())

latestVer, err := semver.NewVersion(cv.Status.History[0].Version)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

History[0] is the most recent entry but may be State: Partial during an in-progress upgrade, so this can read a version the cluster hasn't fully reached. Prefer cv.Status.Desired.Version (or the first History entry with State == Completed) for capability gating.

volMetadata := vols[0].Metadata
e2e.Logf("volume metadata %q", volMetadata)
for k, v := range metadata {
v1, ok := volMetadata[k]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor: v1 shadows the v1 "k8s.io/api/core/v1" import. It compiles fine since the package isn't referenced in this block, but renaming (e.g. got) reads more clearly.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants