Skip to content

[cinder-csi-plugin] Use context #2864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stephenfin
Copy link
Member

What this PR does / why we need it:

Use the generated VolumeContext.

Which issue this PR fixes(if applicable):
fixes #2863

Special notes for reviewers:

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Mar 24, 2025
@k8s-ci-robot k8s-ci-robot requested review from mdbooth and zetaab March 24, 2025 18:01
@k8s-ci-robot
Copy link
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 zetaab for approval. For more information see the Code Review Process.

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

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 24, 2025
@stephenfin
Copy link
Member Author

/cc @kayrus

...again since #2743 was your PR so I'd like to make sure I'm not missing anything obvious 😅

@k8s-ci-robot k8s-ci-robot requested a review from kayrus March 24, 2025 18:02
Looks like an oversight in commit 7bfb2eb.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
@mandre
Copy link
Contributor

mandre commented Apr 7, 2025

/cc @kayrus

...again since #2743 was your PR so I'd like to make sure I'm not missing anything obvious 😅

I think you meant #2687, where volCtx was introduced but never used.

@@ -220,8 +220,8 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
return nil, status.Errorf(codes.InvalidArgument, "failed to resolve anti-affinity volume UUIDs: %v", err)
}

volCtx = util.SetMapIfNotEmpty(volCtx, "affinity", affinity)
volCtx = util.SetMapIfNotEmpty(volCtx, "anti-affinity", antiAffinity)
volCtx[affinityKey] = affinity
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to change the behavior, as it can now set volCtx[affinityKey] or volCtx[antiAffinityKey] to an empty value, while previously it could not. Are we sure this is the intended behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct, the behavior has been changed. cinder.csi.openstack.org/anti-affinity != anti-affinity. volCtx will represent the resolved volume anti-affinities, and this info should be available in PV. So the flow is PVC annotation -> PV parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cinder-csi-plugin] Volume context is not used
4 participants