Skip to content

[GEP-33] Adoption of Capabilities Cloudprofile-API Change#1480

Merged
hebelsan merged 13 commits intogardener:masterfrom
Roncossek:capability-flavors
Oct 1, 2025
Merged

[GEP-33] Adoption of Capabilities Cloudprofile-API Change#1480
hebelsan merged 13 commits intogardener:masterfrom
Roncossek:capability-flavors

Conversation

@Roncossek
Copy link
Copy Markdown
Contributor

How to categorize this PR?

/area control-plane
/kind enhancement
/platform aws

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

It adopts api changes to the alpha feature of CloudProfileCapabilities made in gardener/gardener#12751:

The field CapabilitySets of MachineImageVersion is renamed to CapabilityFlavors to improve readability and avoid confusion with by e.g. a "set of capability values for a given capability name". As a consequence the corresponding field spec.ProviderConfig.MachineImages[].Versions[].capabilitySets is renamed to CapabilityFlavors as well.

The change to spec.machineCapabilities is to stay in line with machineTypes and machineImages.

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

Special notes for your reviewer:

Release note:

The following fields in the `CloudProfile` have been renamed: `spec.ProviderConfig.MachineImages[].Versions[].capabilitySets` -> `spec.ProviderConfig.MachineImages[].Versions[].capabilityFlavors`
Please update your `CloudProfile`s accordingly if you are using capabilities (currently in alpha state).

@gardener-robot gardener-robot added kind/api-change API change with impact on API users needs/second-opinion Needs second review by someone else area/control-plane Control plane related kind/enhancement Enhancement, improvement, extension platform/aws Amazon web services platform/infrastructure needs/review Needs review size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 17, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 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 Sep 17, 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 Sep 17, 2025
Copy link
Copy Markdown
Contributor

@hebelsan hebelsan left a comment

Choose a reason for hiding this comment

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

looks good, only two small nits.


// CapabilitySet groups all RegionAMIMappings for a specific et of capabilities.
type CapabilitySet struct {
// MachineImageFlavor groups all RegionAMIMappings for a specific et of capabilities.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

set of capabilities instead of et of capabilities

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fair point ...

func filterCapabilitySetsByRegion(capabilitySets []api.CapabilitySet, regionName string) []*api.CapabilitySet {
var compatibleSets []*api.CapabilitySet
func filterCapabilityFlavorsByRegion(capabilityFlavors []api.MachineImageFlavor, regionName string) []*api.MachineImageFlavor {
var compatibleSets []*api.MachineImageFlavor
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

var compatibleSets renaming the variable to compatibleFlavors improves readability.

@gardener-robot-ci-2 gardener-robot-ci-2 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 Sep 18, 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 Sep 18, 2025
@gardener-robot-ci-2 gardener-robot-ci-2 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 Sep 19, 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 Sep 19, 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 Sep 19, 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 Sep 19, 2025
@gardener-robot-ci-2 gardener-robot-ci-2 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 Sep 29, 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 Sep 29, 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 Sep 29, 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 Sep 29, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 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 Sep 30, 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 Sep 30, 2025

func validateRegions(regions []apisaws.RegionAMIMapping, version, name string, hasCloudProfileCapabilities bool, jdxPath *field.Path) field.ErrorList {
// validateRegions validates the regions of a machine image version or capability flavor.
func validateRegions(regions []apisaws.RegionAMIMapping, version, name string, capabilityDefinitions []gardencorev1beta1.CapabilityDefinition, jdxPath *field.Path) field.ErrorList {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The signature of validateRegions is (regions []..., version, name string, ...), but all call sites pass (name, version, ...) this looks like an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reordered the parameter. And added some UT to check the output of the error details.

if isCapabilitiesCloudProfile {
capabilityDefinitions = []gardencorev1beta1.CapabilityDefinition{
{Name: "some-capability", Values: []string{"a", "b", "c"}},
{Name: v1beta1constants.ArchitectureName, Values: []string{v1beta1constants.ArchitectureAMD64, v1beta1constants.ArchitectureARM64}},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did you you remove the constants?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See "Use constants in test code with care" in the test guide.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From the test guide I read that one shouldn't use constants from the same package as the tested code.
But anyway I'm fine with the change.

namePool2 = "pool-2"
minPool2 = 30
maxPool2 = 45
priorityPool2 = 100
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did you remove the priority field?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, my bad. The field was changed from int32 to *int32 in the latest gardener. I correctly adopted it now.

@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 Oct 1, 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 Oct 1, 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 Oct 1, 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 Oct 1, 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 Oct 1, 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 Oct 1, 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 Oct 1, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 1, 2025

This change set involves significant updates to a project related to managing cloud profiles and machine images. Key updates focus on transitioning from "CapabilitySets" to "MachineImageFlavors," updating dependencies, improving validation and mutation logic, and code structuring. The updates are aimed at enhancing the functionality of managing machine images and their capabilities in a cloud environment, potentially leading to better compatibility and configuration validation.

Walkthrough

  • Refactor: Transition from "CapabilitySets" to "MachineImageFlavors" across various files, impacting how machine image capabilities are managed.
  • Chore: Dependency updates across modules, bringing in latest compatible versions.
  • New Feature: Added a mutator for CloudProfiles to update capability flavors, enhancing dynamic configuration capabilities.
  • Test: New test files and modifications for testing the updated capabilities and configurations.
  • Documentation: Adjustments to existing documentation reflecting the change from "CapabilitySet" to "MachineImageFlavor".

Model: gpt-4o | Prompt Tokens: 54073 | Completion Tokens: 191

@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 Oct 1, 2025
Copy link
Copy Markdown
Contributor

@hebelsan hebelsan left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review needs/second-opinion Needs second review by someone else labels Oct 1, 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 Oct 1, 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 Oct 1, 2025
@hebelsan hebelsan merged commit 86af17b into gardener:master Oct 1, 2025
63 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Oct 1, 2025
Bobi-Wan added a commit to Bobi-Wan/inventory that referenced this pull request Nov 4, 2025
…ws version to get fix for breaking spec

Bug:
While strict decoding a providerConfig (defined in aws extension),
we encounter a field name change (capabilitySets -> capabilityFlavours).
Even though we don't use it, the strict decoder fails and reports an error.

PR breaking the current functionality:
gardener/gardener-extension-provider-aws#1480

Fix: bump to provider extension aws, so the expencted
cloudprofile.spec.providerconfig has the same schema as the
ones in the dev landscape.
Bobi-Wan added a commit to Bobi-Wan/inventory that referenced this pull request Nov 4, 2025
…ws version to get fix for breaking spec

Bug:
While strict decoding a providerConfig (defined in aws extension),
we encounter a field name change (capabilitySets -> capabilityFlavours).
Even though we don't use it, the strict decoder fails and reports an error.

PR breaking the current functionality:
gardener/gardener-extension-provider-aws#1480

Fix: bump to provider extension aws, so the expencted
cloudprofile.spec.providerconfig has the same schema as the
ones in the dev landscape.
Bobi-Wan added a commit to Bobi-Wan/inventory that referenced this pull request Nov 5, 2025
…et fix for breaking spec

Bug:
While strict decoding a providerConfig (defined in aws extension),
we encounter a field name change (capabilitySets -> capabilityFlavours).
Even though we don't use it, the strict decoder fails and reports an error.

PR breaking the current functionality:
gardener/gardener-extension-provider-aws#1480

Fix: bump to provider extension aws, so the expencted
cloudprofile.spec.providerconfig has the same schema as the
ones in the dev landscape.
Bobi-Wan added a commit to gardener/inventory that referenced this pull request Nov 5, 2025
…et fix for breaking spec

Bug:
While strict decoding a providerConfig (defined in aws extension),
we encounter a field name change (capabilitySets -> capabilityFlavours).
Even though we don't use it, the strict decoder fails and reports an error.

PR breaking the current functionality:
gardener/gardener-extension-provider-aws#1480

Fix: bump to provider extension aws, so the expencted
cloudprofile.spec.providerconfig has the same schema as the
ones in the dev landscape.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/control-plane Control plane related kind/api-change API change with impact on API users kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/aws Amazon web services platform/infrastructure reviewed/lgtm Has approval for merging size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/closed Issue is closed (either delivered or triaged)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants