Skip to content

Conversation

loktev-d
Copy link
Contributor

@loktev-d loktev-d commented Sep 2, 2025

Description

Added validation to prevent empty strings in allowedStorageClassSelector.matchNames configuration for VirtualDisks and VirtualImages. The fix includes:

  • OpenAPI schema validation with minLength: 1 for array items
  • Runtime validation in controller startup that fails fast if empty env vars are detected

Why do we need it, and what problem does it solve?

When allowedStorageClassSelector.matchNames: [""] was configured in ModuleConfig the restriction didn't work, allowing creation of disks with any storage class

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vd,vi
type: fix
summary: Prevent empty strings in allowedStorageClassSelector configuration for VirtualDisks and VirtualImage

Signed-off-by: Daniil Loktev <[email protected]>
@loktev-d loktev-d added this to the v0.26.0 milestone Sep 2, 2025
Signed-off-by: Daniil Loktev <[email protected]>
@loktev-d loktev-d marked this pull request as draft September 2, 2025 13:21
Signed-off-by: Daniil Loktev <[email protected]>
Signed-off-by: Daniil Loktev <[email protected]>
Signed-off-by: Daniil Loktev <[email protected]>
Signed-off-by: Daniil Loktev <[email protected]>
Signed-off-by: Daniil Loktev <[email protected]>
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 4, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 4, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 4, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 4, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 4, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 4, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 5, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: cancelled.

Signed-off-by: Daniil Loktev <[email protected]>
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 5, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: cancelled.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 5, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 5, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 5, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 8, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 8, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: cancelled.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 8, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 8, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 8, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: cancelled.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 8, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 9, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 9, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 9, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 9, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 9, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: success.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 9, 2025
@loktev-d loktev-d changed the title fix(vd,vi): enforce storage class restrictions in webhook validators fix(vd,vi): prevent empty storage class in allowedStorageClassSelector Sep 10, 2025
@loktev-d loktev-d marked this pull request as ready for review September 10, 2025 07:48
@loktev-d loktev-d marked this pull request as draft September 10, 2025 09:10
@nevermarine nevermarine modified the milestones: v1.0.0, v1.1.0 Sep 11, 2025
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Sep 12, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Sep 12, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: success.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Sep 12, 2025
@loktev-d loktev-d marked this pull request as ready for review September 15, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants