Skip to content

[IMPROVEMENT] Move volume spec size validation to longhorn-manager for V2 engine #11718

@davidcheng0922

Description

@davidcheng0922

Is your improvement request related to a feature? Please describe (👍 if you like this request)

In the current Longhorn V2 engine implementation, the function rounds the requested volume size to match the SPDK clusterSize (typically 1 MiB) and returns an error if the size is not aligned.

However, this logic introduces redundant and potentially inconsistent behavior because the longhorn-manager webhook (mutator.go) already rounds up the requested volume size to 2 MiB before persisting it.

Describe the solution you'd like

We should remove the volume spec size validation and rounding logic from the V2 engine's function (ex Expand() )in longhorn-spdk-engine, and instead move this validation entirely into the webhook layer in longhorn-manager.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

area/admission-webhookKubernetes validation and mutating admission webhooksarea/v2-data-enginev2 data engine (SPDK)area/volume-expansionVolume expansion relatedkind/improvementRequest for improvement of existing functionrequire/backportRequire backport. Only used when the specific versions to backport have not been definied.require/docRequire updating the longhorn.io documentationrequire/manual-test-planRequire adding/updating manual test cases if they can't be automated

Type

No type

Projects

Status

Review

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions