-
Notifications
You must be signed in to change notification settings - Fork 370
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
upcoming: [M3-8881, M3-8885] - Add and update beta endpoints and queries for LKE-E #11302
upcoming: [M3-8881, M3-8885] - Add and update beta endpoints and queries for LKE-E #11302
Conversation
apl_enabled?: boolean; // this is not the ideal solution, but a necessary compromise to prevent a lot of duplicated code. | ||
/** Marked as 'optional' in this existing interface to prevent duplicated code for beta functionality, in line with the apl_enabled approach. | ||
* @todo LKE-E - Make this field required once LKE-E is in GA. tier defaults to 'standard' in the API. | ||
*/ | ||
tier?: KubernetesTier; |
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.
Context for this is here.
Coverage Report: ✅ |
/** getKubernetesTieredVersion | ||
* | ||
* Returns a single tiered Kubernetes version by ID from the beta API. | ||
* | ||
*/ | ||
|
||
export const getKubernetesTieredVersion = (versionID: string) => | ||
Request<KubernetesTieredVersion>( | ||
setMethod('GET'), | ||
setURL( | ||
`${BETA_API_ROOT}/lke/versions/:tier/${encodeURIComponent(versionID)}` | ||
) | ||
); |
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.
Struggling to understand the purpose of this endpoint... my understanding is that it just returns the same data from the request (the version and the tier)... will this change in the future?
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.
This beta endpoint (which I should have named getKubernetesTieredVersionBeta
, fixed this in last commit) returns a single version (which is now version id + tier). The other new beta endpoint (getKubernetesTieredVersionsBeta) returns multiple versions.
The existing endpoints (/versions/{versionId} and /versions) only return a version id (so only standard, e.g. current LKE versions), so in a sense they will be 'deprecated'.
Does that help any?
Edit: Yeah, after re-reading this comment "it just returns the same data from the request", you're right... and we also don't seem to use its older counterpart getKubernetesVersion anywhere in CM. Do we keep these in the apiv4 for completeness? (As to 'will this change the future' - not in any specs I've seen so far.)
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.
I'm fine with keeping it in apiv4 for completeness
useBetaEndpoint | ||
? getAllKubernetesClustersBeta() | ||
: getAllKubernetesClusters(), | ||
queryKey: [useBetaEndpoint], |
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.
Should the queryKey be a boolean?
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.
It currently is a boolean - do you think it should be something else, like [useBetaEndpoint ? 'beta' : 'nonbeta']?
This was following a pattern that is already working for APL with the singular getKubernetesCluster
endpoint (which we'd want to replicate here with getKubernetesClusters
). My understanding is that we add something (boolean) to the query key to be able to switch between beta and non-beta endpoints and cache each response correctly.
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.
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.
As long as we make the change consistent across all query keys where we're toggling between endpoints, that sounds fine to me. (Unless I'm missing a particular reason that @bnussman-akamai chose a boolean.)
What's the correct term for "non-beta"? "public", "final"... just null
? 'v4beta' and 'v4'?
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.
I went with v4
and v4beta
in 6f28d2a - lmk if you have any other suggestions or see anything unexpected with caching.
Account with the LKE-E customer tag and without being enrolled in APL beta | Account without the LKE-customer tag and without being enrolled in APL beta |
---|---|
![]() |
![]() |
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.
Nice. v4
and v4beta
is a good idea. 🧠 I just picked the boolean
earlier because it was quick and easy.
Cloud Manager UI test results🎉 454 passing tests on test run #5 ↗︎
|
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.
- Confirm there are no regressions when creating and getting a cluster with APL enabled.
- Confirm the changes match the API spec (by viewing the spec in the Preview section above)
Description 📝
This PR supports the
/v4beta
endpoints and queries necessary for LKE-E.(Except /regions, which will be done in M3-8884.)
Changes 🔄
KubernetesTieredVersion
andKubernetesTier
tier
fieldv4beta/lke/versions/{tier}
andv4beta/lke/versions/{tier}/{versionId}
, andv4beta/lke/clusters
Preview 📷
API Spec: POST /v4beta/lke/clusters
API Spec: GET /v4beta/lke/clusters
API Spec: GET /v4beta/lke/clusters/{clusterID}
API Spec: GET /v4beta/lke/versions/{tier}
API Spec: GET /v4beta/lke/versions/{tier}/{versionId}
How to test 🧪
Prerequisites
(How to setup test environment)
Verification steps
(How to verify changes)
As an Author, I have considered 🤔
As an Author, before moving this PR from Draft to Open, I confirmed ✅