-
Notifications
You must be signed in to change notification settings - Fork 367
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
fix: [M3-9022, M3-9027] - Filter regions by endpoints and fix unavailable regions #11432
Conversation
|
||
// Single pass through errors to collect all region labels | ||
errors.forEach((error) => { | ||
if ('endpoint' in error && error.endpoint) { |
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.
The error
here can be either a Gen1 or Gen2 error - hence the type guard to check if the property exists.
error: BucketError | BucketErrorGen2
interface UnavailableRegionsDisplayProps { | ||
unavailableRegions: Region[]; | ||
interface UnavailableRegionLabelsProps { | ||
regionLabels: string[]; |
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.
No need for an array of Region
's since all we need are the label
's. This allowed for cleaner typings since error formats are different. We couldn't pull from unavailableRegion.label
since that wasn't a property on the new endpoint errors.
@cpathipa @coliu-akamai I'll get you access to the account for testing |
Coverage Report: ✅ |
'de-fra-2', | ||
'sg-sin-2', | ||
]); | ||
|
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 is because we cannot add these to our OBJ data centers list in api until GA or until OBJ region capabilities is customer aware.
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.
vgood here: All looks good to me! I tested with both a user who has access to the limited access regions and a user who does not, and both functioned as expected/desired.
I'm only somewhat proficient with react and not at all with typescript, so my actual code review might not count for much, but I don't see anything glaringly wrong. 🙂 And as mentioned, functionality is good 👍
...ges/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyTable/HostNameTableCell.tsx
Outdated
Show resolved
Hide resolved
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.
gonna review the functionality after retro! in between a lot of meetings today 😅
packages/manager/src/features/ObjectStorage/AccessKeyLanding/OMC_AccessKeyDrawer.tsx
Outdated
Show resolved
Hide resolved
functionality looking good too! will give a final approval/check after custom hook changes are pushed up 🚀 |
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.
reconfirming functionality + code review, thank you!
… use id" This reverts commit 3eb4ebc.
Cloud Manager UI test results🎉 466 passing tests on test run #12 ↗︎
|
@@ -61,6 +63,7 @@ export const RegionSelect = < | |||
|
|||
const regionOptions = getRegionOptions({ | |||
currentCapability, | |||
isObjectStorageGen2Enabled, |
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 is temporary as noted in getRegionOptions
until APINext makes Gen2 region capabilities customer-aware.
@@ -114,7 +117,7 @@ export const RegionSelect = < | |||
<RegionOption | |||
disabledOptions={disabledRegions[region.id]} | |||
item={region} | |||
key={key} | |||
key={`${region.id}-${key}`} |
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.
key
which is the region label is no longer specific enough since we now can have multiple endpoints per region
@@ -60,9 +60,10 @@ export const BucketRateLimitTable = ({ | |||
<Box> | |||
<FormLabel> | |||
<Typography | |||
{...typographyProps} |
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.
Moved the spreading of props to the top to allow overrides
regionsAffected.map((thisRegion) => ( | ||
<li key={thisRegion}>{thisRegion}</li> | ||
regionsAffected.map((thisRegion, idx) => ( | ||
<li key={`${thisRegion}-${idx}`}>{thisRegion}</li> |
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.
Same issue as above - multiple endpoints can exist in a region
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.
✅ functionality as specified
✅ user without gen2 flags/capabilities doesn't see gen 2 regions (whoops typo)
thank you!
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.
Confirming bucket and access create flow are working as expected for legacy and gen1
Description 📝
Note
This code relies on the
/endpoints
, which is activated through customer tags and capabilities. If endpoints is not available, we fallback to using regions and clusters for bucket retrieval.Changes 🔄
object-storage/endpoints
endpoint. This has to be done in 3 places:/object-storage/access-keys
page when displaying regionsuseObjectStorageRegions
hook that filters regions byendpoints
if user has Gen2 capabilities, otherwise falls back to all regions for backwards compatibility for legacy and multi-cluster.Target release date 🗓️
Before 12/20 (Friday)
Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
Reproduction steps
(How to reproduce the issue, if applicable)
/object-storage/buckets
in PROD and observe unavailable regions derived from our endpoints are not displayed due to difference in how we formatted the errors.Verification steps
(How to verify changes)
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅