Skip to content

Commit

Permalink
use region capability to filter unsupported entities
Browse files Browse the repository at this point in the history
  • Loading branch information
hana-akamai committed Feb 15, 2024
1 parent c885d0b commit 6ef201a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
18 changes: 16 additions & 2 deletions packages/manager/src/cachedData/regions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5",
"ipv6": "2400:8904::f03c:91ff:fea5:659, 2400:8904::f03c:91ff:fea5:9282, 2400:8904::f03c:91ff:fea5:b9b3, 2400:8904::f03c:91ff:fea5:925a, 2400:8904::f03c:91ff:fea5:22cb, 2400:8904::f03c:91ff:fea5:227a, 2400:8904::f03c:91ff:fea5:924c, 2400:8904::f03c:91ff:fea5:f7e2, 2400:8904::f03c:91ff:fea5:2205, 2400:8904::f03c:91ff:fea5:9207"
},
"site_type": "edge"
"site_type": "core"
},
{
"id": "ca-central",
Expand Down Expand Up @@ -430,6 +430,20 @@
},
"site_type": "core"
},
{
"id": "us-edgetest",
"label": "Gecko Edge Test",
"country": "us",
"capabilities": [
"Linodes"
],
"status": "ok",
"resolvers": {
"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, 23.239.18.5",
"ipv6": "2600:3c02::3, 2600:3c02::5, 2600:3c02::4, 2600:3c02::6, 2600:3c02::c, 2600:3c02::7, 2600:3c02::2, 2600:3c02::9, 2600:3c02::8, 2600:3c02::b"
},
"site_type": "edge"
},
{
"id": "us-southeast",
"label": "Atlanta, GA",
Expand All @@ -451,7 +465,7 @@
"ipv4": "74.207.231.5, 173.230.128.5, 173.230.129.5, 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, 50.116.41.5, 23.239.18.5",
"ipv6": "2600:3c02::3, 2600:3c02::5, 2600:3c02::4, 2600:3c02::6, 2600:3c02::c, 2600:3c02::7, 2600:3c02::2, 2600:3c02::9, 2600:3c02::8, 2600:3c02::b"
},
"site_type": "edge"
"site_type": "core"
},
{
"id": "us-east",
Expand Down
21 changes: 12 additions & 9 deletions packages/manager/src/components/RegionSelect/RegionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,19 @@ export const RegionSelect = React.memo((props: RegionSelectProps) => {
}
}, [selectedId]);

// Hide edge sites from Marketplace, Create NodeBalancer, Create LKE, and Image Upload
const unsupportedEdgeEntities =
['Images', 'One-Click'].includes(createType) ||
[
'/images/create/upload',
'/kubernetes/create',
'/nodebalancers/create',
].includes(location.pathname);
// Hide edge sites from Marketplace and Images
const unsupportedEdgeEntities = ['Images', 'One-Click'].includes(createType);
const geckoEnabled = Boolean(flags.gecko && !unsupportedEdgeEntities);

const showGeckoHelperText =
geckoEnabled &&
currentCapability &&
regions.find(
(region) =>
region.site_type === 'edge' &&
region.capabilities.includes(currentCapability)
);

const options = React.useMemo(
() =>
getRegionOptions({
Expand Down Expand Up @@ -172,7 +175,7 @@ export const RegionSelect = React.memo((props: RegionSelectProps) => {
placeholder="Select a Region"
value={selectedRegion}
/>
{geckoEnabled && ( // @TODO Gecko MVP: Add docs link
{showGeckoHelperText && ( // @TODO Gecko MVP: Add docs link
<StyledEdgeBox>
<EdgeServer />
<Typography sx={{ textWrap: 'nowrap' }}>
Expand Down

0 comments on commit 6ef201a

Please sign in to comment.