Skip to content

[GEP-33] Add Capability support#1222

Merged
AndreasBurger merged 20 commits intogardener:masterfrom
Vincinator:capabilities
Jan 15, 2026
Merged

[GEP-33] Add Capability support#1222
AndreasBurger merged 20 commits intogardener:masterfrom
Vincinator:capabilities

Conversation

@Vincinator
Copy link
Copy Markdown
Contributor

@Vincinator Vincinator commented Dec 11, 2025

How to categorize this PR?

/area control-plane
/kind enhancement
/platform openstack

What this PR does / why we need it:
This PR is part of GEP-33 Machine Image Capabilities

It adopts the introduced Cloud Profile Capabilities from Gardener. It offers a mechanism to define a relationships between MachineTypes and MachineImages to ensure only compatible amis are selected for a given MachineType. An example for a Capability is the CPU architecture that is added as the first mandatory Capability. The existing architecture field is planned to be removed eventually.

As the CloudProfile size is limited this PR aims to eliminate repetition of Capabilities in the providerConfig. To do that an additional grouping of region-ami-mapping is introduced; called CapabilitySet. One CapabilitySet contains all amis that offer the same Capabilities, e.g. architecture: amd64.

Openstack-Specific Adaptations:
Since OpenStack supports global image names (in addition to region-specific imageIDs), this implementation includes:

  • Support for using machineImage.Image when no region-specific imageIDs are specified
  • Comprehensive test coverage via DescribeTableSubTree testing all combinations:
    • With capabilities and machineImageIDs
    • With capabilities and machineImage
    • Without capabilities and machineImageIDs
    • Without capabilities and machineImage
  • Refactored pkg/controller/worker/machines_test.goto use DescribeTableSubTree with parameterized test entries instead of a setup function, enabling comprehensive test coverage for both machineImage and machineImageID scenarios across all test cases.

Which issue(s) this PR fixes:
Part of: gardener/gardener#11301

Special notes for your reviewer:

Requires prior merge of #1218 (which includes changes from gardener/gardener#13138)

Implementation follows the pattern established in provider-aws

Release note:

Implements Machine Image Capabilities support for OpenStack, enabling better compatibility management between MachineTypes and MachineImages through CapabilitySets.

@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@gardener-robot gardener-robot added the kind/api-change API change with impact on API users label Dec 11, 2025
@github-actions github-actions bot added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Dec 11, 2025
@gardener-robot gardener-robot added needs/second-opinion Needs second review by someone else area/control-plane Control plane related kind/enhancement Enhancement, improvement, extension platform/openstack OpenStack platform/infrastructure needs/rebase Needs git rebase labels Dec 11, 2025
@gardener-robot
Copy link
Copy Markdown

@Vincinator You need rebase this pull request with latest master branch. Please check.

@gardener-robot gardener-robot added needs/review Needs review size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 11, 2025
@Vincinator Vincinator changed the title Capabilities [GEP-33] Add Capability support Dec 11, 2025
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2025
@gardener-ci-robot
Copy link
Copy Markdown

The Gardener project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:

  • After 15d of inactivity, lifecycle/stale is applied
  • After 15d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 7d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Mark this PR as rotten with /lifecycle rotten
  • Close this PR with /close

/lifecycle stale

The `SimulateTransformToParentFormat` function simulates changes on copies of the provider configuration.

Move the validation to occur before this simulation. This ensures we are checking the original user input to confirm that only `spec.providerConfig.machineImages` has been set, preventing the simulation from running with an invalid initial state.
* added function for finding best machine image (based on AWS GEP-33 implementation)
* added machineImage.Image logic to ported GEP-33 functions, if machineImage.Image is defined and no imageIDs are specified for each region, the machineImage.Image must be used for selection.

refactor machine_test.go:
* use describeTableSubTree to test capabilities and legacy clpf
* use describeTableSubTree to test if imageName is used instead of imageID and vice versa
* replace setup function with BeforeEach
@gardener-prow gardener-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 15, 2026
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request implements a significant enhancement to the Gardener OpenStack extension by introducing support for machine image capabilities, which represents a migration from the legacy architecture-based system to a more flexible capability-based approach. The changes enable users to specify machine requirements through a structured capabilities system rather than hardcoded architecture fields.

Walkthrough

  • New Feature: Added machine image capability flavors support to CloudProfile and NamespacedCloudProfile configurations, allowing grouping of region mappings by capabilities rather than just architecture
  • New Feature: Implemented CloudProfile mutation webhook to automatically populate capability flavors from provider configurations when machine capabilities are defined
  • Refactor: Enhanced validation logic to support both legacy architecture-based and new capability-based machine image definitions with backward compatibility
  • Refactor: Updated worker controller to select appropriate machine images based on machine type capabilities and image capability flavors
  • New Feature: Added transformation utilities to convert between legacy and capability formats for seamless migration
  • Test: Comprehensive test coverage for new capability-based validation, mutation, and image selection functionality

Model: claude-sonnet-4-20250514 | Prompt Tokens: 57074 | Completion Tokens: 232

@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 15, 2026
@gardener-prow gardener-prow bot added the cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. label Jan 15, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow bot commented Jan 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AndreasBurger, Vincinator

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

The pull request process is described here

Details 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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 15, 2026
@AndreasBurger AndreasBurger merged commit d577f7c into gardener:master Jan 15, 2026
53 checks passed
@ghost ghost added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 19, 2026
@github-actions github-actions bot removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane Control plane related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/api-change API change with impact on API users kind/enhancement Enhancement, improvement, extension lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/rebase Needs git rebase needs/review Needs review needs/second-opinion Needs second review by someone else platform/openstack OpenStack platform/infrastructure size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants