Skip to content

Conversation

@loktev-d
Copy link
Contributor

@loktev-d loktev-d commented Oct 21, 2025

Description

Introduce v1alpha3 version of VirtualMachineClass with percentage string format (e.g., 5 → "5%") for coreFractions. Use Kubernetes conversion webhooks for version compatibility between v1alpha2 and v1alpha3

Key changes

  • v1alpha2: Maintains original coreFractions: []int format for backward compatibility
  • v1alpha3 (storage version): Introduces new coreFractions: []string format with "%" suffix
  • Conversion webhook: Provides automatic bidirectional conversion between versions (v1alpha2 is hub, v1alpha3 is spoke). Injected into VirtualMachineClass CRD on controller startup.
  • Admission webhook: Added conversion to hub version so that validation is compatible with both versions
  • E2E tests: use new v1alpha3 version

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

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: vmclass
type: feature
summary: use percentage format for coreFractions with conversion webhook

Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @loktev-d, your pull request is larger than the review limit of 150000 diff characters

@loktev-d loktev-d marked this pull request as draft October 21, 2025 07:45
loktev-d and others added 2 commits October 21, 2025 11:00
Signed-off-by: Daniil Loktev <70405899+loktev-d@users.noreply.github.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
coreFractions:
description: |
Допустимые значения параметра `coreFraction`.
Допустимые значения параметра `coreFraction` в процентах (например, "5%", "10%", "25%", "50%", "100%").
Copy link
Member

@z9r5 z9r5 Oct 21, 2025

Choose a reason for hiding this comment

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

Suggested change
Допустимые значения параметра `coreFraction` в процентах (например, "5%", "10%", "25%", "50%", "100%").
Максимальная доля использования ядра CPU в процентах (например, "5%", "10%", "25%", "50%", "100%").

Тут каждого ядра? Всех ядер?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Мне кажется немного будет сбивать с толку, потому что тут указываются именно допустимые значения

Copy link
Member

@z9r5 z9r5 Oct 22, 2025

Choose a reason for hiding this comment

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

Мне кажется немного будет сбивать с толку, потому что тут указываются именно допустимые значения

А... тут по сути список возможных coreFractions чтоли. Хм... Блин, описание такое себе конечно. И в целом в спеке есть подобные не понятные штуки.. пупупу...

z9r5
z9r5 previously approved these changes Oct 22, 2025
loktev-d and others added 7 commits October 22, 2025 16:44
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Co-authored-by: Artem Kladov <6360800+z9r5@users.noreply.github.com>
Signed-off-by: Daniil Loktev <70405899+loktev-d@users.noreply.github.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
This reverts commit ca8b840.

Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d force-pushed the feat/vmclass/core-fractions-percentage branch from ffe3f98 to 5458ff6 Compare October 22, 2025 13:45
@loktev-d loktev-d added this to the v1.2.0 milestone Oct 22, 2025
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Oct 30, 2025
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Oct 30, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Oct 30, 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 Oct 30, 2025
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
This reverts commit 1855184.

Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d force-pushed the feat/vmclass/core-fractions-percentage branch from 3684ec9 to 6c747b2 Compare November 7, 2025 10:08
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Nov 7, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Nov 7, 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 Nov 7, 2025
@loktev-d loktev-d added validation/skip/doc_changes Skip doc changes validation e2e/run Run e2e test on cluster of PR author labels Nov 10, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Nov 10, 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 Nov 10, 2025
@Isteb4k Isteb4k marked this pull request as ready for review November 10, 2025 09:20
*/

package v1alpha3

Copy link
Contributor

Choose a reason for hiding this comment

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

var _ conversion.Hub = &VirtualMachineClass{}

Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validation/skip/doc_changes Skip doc changes validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants