Skip to content

Add CSI Volume Sentinel Policy scaffolding #26438

Merged
allisonlarson merged 11 commits intomainfrom
f-add-csi-policy-hooks
Aug 7, 2025
Merged

Add CSI Volume Sentinel Policy scaffolding #26438
allisonlarson merged 11 commits intomainfrom
f-add-csi-policy-hooks

Conversation

@allisonlarson
Copy link
Copy Markdown
Contributor

@allisonlarson allisonlarson commented Aug 5, 2025

Description

Adds in the scaffolding for enabling Sentinel policies for CSI Volumes in enterprise. The additions are a hook for policy enforcement, and adding an override field to the csi create & register requests and a warnings response field. I've also updated the editor in the UI (with tests), and updated the CSI Volume documentation for the new Sentinel policy options. This work is modeled on the Sentinel policy work done for host volumes, so the documentation uses host volumes as the blueprint for the updates.

Testing & Reproduction steps

Some tests have been added that should protect against any issues with the added override and warning fields in the request/responses, but the CSI tests are currently lacking due to the requirement of the running plugin in order to successfully create/register a volume. The tests for the csi volume create and volume register commands don't succeed, and instead test that the error returned is expected (missing plugin). I figured that this is somewhat useful for testing that the new inputs/outputs don't blow up, as opposed to having no test at all, but open to any feedback about how to write a useful test.

Links

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

@allisonlarson allisonlarson requested review from a team as code owners August 5, 2025 18:17
@allisonlarson allisonlarson marked this pull request as draft August 5, 2025 18:30
Comment thread api/csi.go Outdated
tgross
tgross previously approved these changes Aug 6, 2025
Copy link
Copy Markdown
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread website/content/docs/reference/sentinel-policy.mdx Outdated
Copy link
Copy Markdown
Contributor

@aimeeu aimeeu 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 creating/updating the docs. I left some style guide and presentation suggestions. Feel free to contact me if you have questions.

Comment thread website/content/commands/sentinel/apply.mdx Outdated
Comment thread website/content/docs/reference/sentinel-policy.mdx Outdated
Comment thread website/content/api-docs/volumes.mdx
Comment thread website/content/api-docs/volumes.mdx Outdated
Comment thread website/content/api-docs/volumes.mdx Outdated
Copy link
Copy Markdown
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@allisonlarson allisonlarson requested a review from aimeeu August 7, 2025 18:56
Copy link
Copy Markdown
Contributor

@aimeeu aimeeu left a comment

Choose a reason for hiding this comment

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

Awesome!

@allisonlarson allisonlarson merged commit e16a333 into main Aug 7, 2025
65 of 66 checks passed
@allisonlarson allisonlarson deleted the f-add-csi-policy-hooks branch August 7, 2025 19:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 6, 2025

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

theme/docs Documentation issues and enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants