| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
It changes CRD/API and reconciliation behavior for machine image selection/filtering, which should be validated by a human reviewer for backward compatibility and operational impact.
Pull request overviewThis PR introduces capability-based handling of Gardenlinux feature_set OCI annotations: it can (1) expand selected feature_set tokens into boolean CloudProfile capabilities and (2) filter out source images that don’t satisfy a required set of feature_set values before writing them into the CloudProfile.
Changes:
| File | Description |
|---|---|
| crd/cloudprofilesync.cobaltcore.dev_managedcloudprofiles.yaml | Extends the CRD schema with featureSetCapabilities and imageFilter.requiredFeatureSetValues. |
| controllers/managedcloudprofile_controller.go | Updates the OCI source factory interface to accept FeatureSetCapability mappings. |
| controllers/managedcloudprofile_controller_test.go | Adapts controller tests to the updated OCI source factory signature. |
| controllers/cloud_profile.go | Wires FeatureSetCapabilities into OCI source creation and passes ImageFilter into the ImageUpdater. |
| cloudprofilesync/ossync/source/oci/os_source.go | Implements boolean capability expansion from raw feature_set tokens and emits RawCapabilities. |
| cloudprofilesync/ossync/source/oci/os_source_test.go | Updates/extends OCI source tests for boolean capabilities and raw token behavior. |
| cloudprofilesync/ossync/os_image_updater.go | Adds ImageFilter handling and uses raw feature_set values to filter images. |
| cloudprofilesync/ossync/os_image_updater_test.go | Adds ImageUpdater integration tests for imageFilter behavior. |
| cloudprofilesync/ossync/image_filter_test.go | Adds focused unit tests for imagePassesFilter. |
| api/v1alpha1/zz_generated.deepcopy.go | Regenerates deepcopy functions for the new API types/fields. |
| api/v1alpha1/managedcloudprofile.go | Adds API types FeatureSetCapability and ImageFilter and wires them into MachineImageUpdate. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was a problem hiding this comment.
The PR introduces a compilation error in os_source_test.go and there is a confirmed goroutine loop-variable capture bug in os_source.go that can cause wrong tag fetches under concurrency.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review detailscloudprofilesync/ossync/source/oci/os_source_test.go:81
ossync.SourceImage{
Version: "1.0.1+abc",
Architectures: []string{"amd64"},
RawCapabilities: map[string][]string{"feature_set": {}},
}))
Sorry, something went wrong.
There was a problem hiding this comment.
The functional changes are covered by targeted unit/integration tests and the remaining feedback is limited to minor naming consistency in comments/test descriptions.
Review detailscloudprofilesync/ossync/source/oci/os_source_test.go:318
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:356
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
There was a problem hiding this comment.
The updated OCI source test file contains invalid Go syntax ([]string value written as {}) which will fail compilation.
Review detailscloudprofilesync/ossync/source/oci/os_source.go:31
// annotation directly, independent of the featureSetCapabilities configuration,
cloudprofilesync/ossync/source/oci/os_source_test.go:74
Version: "1.0.0",
Architectures: []string{"amd64"},
RawCapabilities: map[string][]string{"feature_set": {}},
}))
cloudprofilesync/ossync/source/oci/os_source_test.go:80
ossync.SourceImage{
Version: "1.0.1+abc",
Architectures: []string{"amd64"},
RawCapabilities: map[string][]string{"feature_set": {}},
}))
Sorry, something went wrong.
There was a problem hiding this comment.
The current diff includes a compile-breaking Go test literal ([]string initialized with {}) and a misconfiguration bug where featureToCapabilityMap can overwrite the reserved architecture capability.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review detailscloudprofilesync/ossync/source/oci/os_source_test.go:73
RawCapabilities: map[string][]string{"feature_set": {}},
cloudprofilesync/ossync/source/oci/os_source_test.go:79
RawCapabilities: map[string][]string{"feature_set": {}},
cloudprofilesync/ossync/source/oci/os_source_test.go:83
It("expands featureSetCapabilities into boolean capabilities from feature_set annotation", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:318
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:356
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
There was a problem hiding this comment.
The feature-set based filtering/mapping is implemented end-to-end (API → controller wiring → OCI source → updater) with solid test coverage, with only minor wording/spelling nits noted.
Review detailsPreviously missed (1) — in code that hasn't changed since the last review.
cloudprofilesync/ossync/os_image_updater_test.go:726
cloudprofilesync/ossync/os_image_updater.go:22
// ArchitectureCapability is the well-known Gardener capability key for CPU architecture. // It is read from the "architecture" OCI annotation and excluded from the user-configured // capabilityKeys since it is always populated automatically by the OCI source.
cloudprofilesync/ossync/os_image_updater.go:242
// causing unnecesscary reconciliations.
cloudprofilesync/ossync/source/oci/os_source_test.go:83
It("expands featureSetCapabilities into boolean capabilities from feature_set annotation", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:318
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:356
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
There was a problem hiding this comment.
The functional changes are coherent and covered by updated/new tests, with only minor doc/test-description nits noted.
Review detailscloudprofilesync/ossync/os_image_updater.go:21
// ArchitectureCapability is the well-known Gardener capability key for CPU architecture. // It is read from the "architecture" OCI annotation and excluded from the user-configured // capabilityKeys since it is always populated automatically by the OCI source. const ArchitectureCapability = "architecture"
cloudprofilesync/ossync/source/oci/os_source_test.go:82
It("expands featureSetCapabilities into boolean capabilities from feature_set annotation", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:316
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:354
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
There was a problem hiding this comment.
There is a confirmed nondeterminism risk in capability generation when multiple feature_set values map to the same capability name (map iteration order), and it should be validated or made deterministic before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review detailscloudprofilesync/ossync/os_image_updater.go:23
// It is read from the "architecture" OCI annotation and excluded from the user-configured // capabilityKeys since it is always populated automatically by the OCI source. const ArchitectureCapability = "architecture" // FeatureSetAnnotation is the gardenlinux OCI annotation key that carries the image's
cloudprofilesync/ossync/source/oci/os_source_test.go:82
It("expands featureSetCapabilities into boolean capabilities from feature_set annotation", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:316
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:354
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
There was a problem hiding this comment.
It changes CRD/API surface area and modifies core machine-image selection behavior (filtering + capability expansion), which warrants final human verification of compatibility and rollout impact.
Review detailscloudprofilesync/ossync/os_image_updater.go:23
// It is read from the "architecture" OCI annotation and excluded from the user-configured // capabilityKeys since it is always populated automatically by the OCI source. const ArchitectureCapability = "architecture" // FeatureSetAnnotation is the gardenlinux OCI annotation key that carries the image's
cloudprofilesync/ossync/source/oci/os_source.go:26
// usiImageFeature is the normalized capability value for the gardenlinux USI // (UEFI Secure Image) feature, which indicates support for in-place node updates. usiImageFeature = "_usi"
cloudprofilesync/ossync/source/oci/os_source_test.go:82
It("expands featureSetCapabilities into boolean capabilities from feature_set annotation", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:316
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:354
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
There was a problem hiding this comment.
The new featureToCapabilityMap path lacks validation for empty/duplicate capability names (risking invalid/nondeterministic capabilities output), and there is a renamed-function comment mismatch that should be corrected for clarity.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review detailscloudprofilesync/ossync/source/oci/os_source.go:81
func NewOCI(params ocirepo.Params, parallel int64, log logr.Logger, featureToCapabilityMap map[string]string, imageFilter *v1alpha1.ImageFilter) (*OCI, error) {
repo, err := ocirepo.New(params)
if err != nil {
return nil, err
}
cloudprofilesync/ossync/source/oci/os_source.go:26
// usiImageFeature is the value for the gardenlinux USI (UEFI Secure Image) feature, // which indicates support for in-place node updates. usiImageFeature = "_usi"
Sorry, something went wrong.
There was a problem hiding this comment.
The boolean capability expansion can be nondeterministic when multiple feature_set values map to the same capability name due to Go map iteration/overwrite behavior, which should be made deterministic before merge.
Review detailscloudprofilesync/ossync/source/oci/os_source.go:140
_, present := rawFeatureSet[featureSetValue]
if present {
caps[capabilityName] = []string{"true"}
} else {
caps[capabilityName] = []string{"false"}
cloudprofilesync/ossync/os_image_updater.go:74
func validateImageVersions(log logr.Logger, versions []SourceImage) []SourceImage {
Sorry, something went wrong.
Merging this branch changes the coverage (1 decrease, 2 increase)
Coverage by file Changed files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Sorry, something went wrong.
There was a problem hiding this comment.
Only minor naming/documentation inconsistencies remain (test descriptions and a stale comment), with core logic and coverage appearing complete.
Review detailscloudprofilesync/ossync/os_image_updater.go:25
// FeatureSetAnnotation is the gardenlinux OCI annotation key that carries the image's // feature set as a comma-separated list (e.g. "sci,_usi,vhost"). const FeatureSetAnnotation = "feature_set"
cloudprofilesync/ossync/source/oci/os_source_test.go:82
It("expands featureSetCapabilities into boolean capabilities from feature_set annotation", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:316
It("detects SupportInPlaceUpdate from feature_set even when featureSetCapabilities is empty", func(ctx SpecContext) {
cloudprofilesync/ossync/source/oci/os_source_test.go:354
It("populates CleanVersion from version annotation even when featureSetCapabilities is empty", func(ctx SpecContext) {
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
machineCapabilities: - name: architecture values: [ amd64 ] - name: vhost values: [ "true", "false" ] - name: usidev values: [ "true", "false" ] machineTypes: - name: baremetal cpu: "40" gpu: "0" memory: 300Gi capabilities: architecture: [ amd64 ] vhost: [ "false" ] usidev: [ "false" ] - name: baremetal-compute cpu: "40" gpu: "0" memory: 300Gi capabilities: architecture: [ amd64 ] vhost: [ "true" ] usidev: [ "false" ] - name: baremetal-compute-dev cpu: "40" gpu: "0" memory: 300Gi capabilities: architecture: [ amd64 ] vhost: [ "true" ] usidev: [ "true" ] machineImageUpdates: - imageName: gardenlinux source: oci: registry: my-test-registry repository: my/test/repo imageFilter: requiredFeatureSetValues: [ scibase, _usi ] featureToCapabilityMap: vhost: vhost _usidev: usidev provider: ironcoreMetal: registry: my-test-registry repository: my/test/repo