-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSD-22892 (Part 1): Machine ID Lookup Table #240
OSD-22892 (Part 1): Machine ID Lookup Table #240
Conversation
Probe.GetMachineImageID() provides a standardized interface for supplying AMI/GCP machine image/etc. information to consumers of Probes. A lookup-table-based reference implementation is provided for CurlJSONProbe
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
==========================================
+ Coverage 26.32% 27.42% +1.09%
==========================================
Files 11 11
Lines 1056 1072 +16
==========================================
+ Hits 278 294 +16
Misses 764 764
Partials 14 14
|
/lgtm |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rafael-azevedo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@abyrne55: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
What does this PR do? / Related Issues / Jira
This PR is composed of commits cherry-picked from my larger OSD-22892 branch for the sake of readability.
These commits cover the definition of the Probe interface's
GetMachineImageID()
method, as well as a reference implementation for the CurlJSONProbe. This method takes 3 string arguments (platformType
,cpuArch
, andregion
) and returns a "machine image ID," which is a cloud-platform-agnostic term for AMI ID. TheplatformType
andcpuArch
arguments should be one of thehelpers.Platform*
andhelpers.Arch*
enumerated string types, respectively, whileregion
is more free-form. An example invocation might look like:On the backend, CurlJSONProbe's implementation of
GetMachineImageID()
is essentially a lookup table, i.e., a multi-level dictionary (in "machine-images.go") containing all the machine image IDs, plus a helper function with some lookup validation logic (e.g., to account for the fact that GCP machine image IDs are not region-specific like AMIs). The x86 AMI IDs included in this PR are the first "RHEL repackaged" images published to the verifier's golden AMI account: these are not expected to change often (maybe 1-3x per year). Ditto for the GCP machine image IDs, which just point to the publicly-available GCP RHEL images. ARM image IDs have placeholder values for now.This PR intentionally does not cover integration of this new code into the verifier's critical path. That integration will be covered in a separate cherry-picked PR. As such, there isn't much to execute for this PR beyond the included unit tests. When reviewing this PR, please focus on code style/structure.
Checklist
[ ] I have made corresponding change to the default configuration files[ ] I have added execution results to the PR's readme