Skip to content

refactor(machineImages): replace distro name guessing with exact vendor lookup - #3000

Merged
gardener-prow[bot] merged 1 commit into
masterfrom
bug/fix-image-vendor-matching
Jun 1, 2026
Merged

refactor(machineImages): replace distro name guessing with exact vendor lookup#3000
gardener-prow[bot] merged 1 commit into
masterfrom
bug/fix-image-vendor-matching

Conversation

@grolu

@grolu grolu commented Jun 1, 2026

Copy link
Copy Markdown
Member

How to categorize this PR?
/area quality
/kind cleanup

What this PR does / why we need it:

Removes getDistroFromImageName which used substring matching to map
machine image names to vendor identifiers. This caused bugs where
images like memoryone-gardenlinux were silently mapped to the
gardenlinux vendor due to greedy includes() checks.

Machine image names are now looked up directly by exact name in the
vendor config. Adds missing vendor entries for gardenlinux-fips and
memoryone-gardenlinux. Unknown images fall back to displaying their
raw name instead of being silently misclassified.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

The old getDistroFromImageName also matched vsmp — this only
appears as a machineType name, never as a machineImage name, so it
was dead code.

Release note:

Fix machine image vendor matching to use exact names instead of substring matching, preventing misclassification of images like memorone-gardenlinux or gardenlinux-fips
Machine image vendor matching no longer uses substring/wildcard patterns. Image names must now exactly match an entry in `knownMachineImageVendors` (or the branding config `vendors.machineImage` array). Images without an exact match will display their raw name without vendor icon or grouping

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for two new machine image vendors: Garden Linux (FIPS) and MemoryOne Garden Linux.
  • Refactor

    • Simplified internal machine image vendor detection logic for improved maintainability.

…or lookup

Remove getDistroFromImageName and its substring-based matching which
silently collapsed distinct images (e.g. memoryone-gardenlinux) into
wrong vendors. Machine image names are now looked up directly in the
vendor config. Unknown images fall back to displaying their raw name.
@gardener-prow gardener-prow Bot added area/quality Output qualification (tests, checks, scans, automation in general, etc.) related kind/cleanup Something that is not needed anymore and can be cleaned up cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 1, 2026
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Machine image vendor resolution is refactored from a two-step indirect lookup (derive distro from image name, then find vendor) to direct vendor lookup. Two new vendor entries are added to the config, the resolution logic is simplified, and the now-unused distro-derivation helper is removed.

Changes

Machine image vendor resolution refactoring

Layer / File(s) Summary
Add new vendor entries
frontend/src/store/config.js
gardenlinux-fips and memoryone-gardenlinux vendors are registered in knownMachineImageVendors with display names, weights, and icons.
Refactor vendor resolution logic
frontend/src/composables/useCloudProfile/useMachineImages.js
Machine image flattening calls configStore.vendorDetails(machineImage.name) directly instead of deriving a distro first and then looking up the vendor.
Remove obsolete distro helper
frontend/src/composables/helper.js
The getDistroFromImageName function and its lodash/lowerCase import are deleted since vendor resolution no longer requires distro derivation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A helper took a detour long,
Through distros dark and names so wrong,
But now we leap direct and true,
To vendors new—gardenlinux grew! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing substring-based distro guessing with exact vendor name lookups.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is comprehensive and follows the template structure with all key sections completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/fix-image-vendor-matching

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@petersutter petersutter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/approve

@gardener-prow gardener-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2026
@gardener-prow

gardener-prow Bot commented Jun 1, 2026

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: 3a4354bc0adc78e62e32fb600c4a7b89d7143851

@gardener-prow

gardener-prow Bot commented Jun 1, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petersutter

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 Jun 1, 2026
@gardener-prow
gardener-prow Bot merged commit 8f0254f into master Jun 1, 2026
69 checks passed
@gardener-prow
gardener-prow Bot deleted the bug/fix-image-vendor-matching branch June 1, 2026 13:52
@grolu

grolu commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

/cherry-pick hotfix-1.84

@gardener-ci-robot

Copy link
Copy Markdown
Contributor

@grolu: new pull request created: #3001

Details

In response to this:

/cherry-pick hotfix-1.84

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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/ipcei IPCEI (Important Project of Common European Interest) area/quality Output qualification (tests, checks, scans, automation in general, etc.) related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/cleanup Something that is not needed anymore and can be cleaned up lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants