refactor(machineImages): replace distro name guessing with exact vendor lookup - #3000
Conversation
…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.
📝 WalkthroughWalkthroughMachine 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. ChangesMachine image vendor resolution refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
LGTM label has been added. DetailsGit tree hash: 3a4354bc0adc78e62e32fb600c4a7b89d7143851 |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick hotfix-1.84 |
|
@grolu: new pull request created: #3001 DetailsIn response to this:
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. |
How to categorize this PR?
/area quality
/kind cleanup
What this PR does / why we need it:
Removes
getDistroFromImageNamewhich used substring matching to mapmachine image names to vendor identifiers. This caused bugs where
images like
memoryone-gardenlinuxwere silently mapped to thegardenlinuxvendor due to greedyincludes()checks.Machine image names are now looked up directly by exact name in the
vendor config. Adds missing vendor entries for
gardenlinux-fipsandmemoryone-gardenlinux. Unknown images fall back to displaying theirraw name instead of being silently misclassified.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
The old
getDistroFromImageNamealso matchedvsmp— this onlyappears as a machineType name, never as a machineImage name, so it
was dead code.
Release note:
Summary by CodeRabbit
Release Notes
New Features
Refactor