From 5573d0dfbc1375cecaa3c46ff01a5631f902d59b Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Tue, 29 Sep 2026 08:16:10 -0400 Subject: [PATCH] fix(studio): disable network restrictions for v3 (AWS_K8S) projects (#50996) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Network restrictions aren't supported on v3 (AWS_K8S) projects, but the Network Restrictions settings section previously only disabled itself for High Availability projects, leaving a fully working (but non-functional) UI for non-HA v3 projects. - Adds `useIsAwsK8sCloudProvider()` to the section's disabled check, alongside a v3-specific disabled notice mirroring the existing High Availability disabled notice pattern. Resolves [FE-4482](https://linear.app/supabase/issue/FE-4482/disable-network-restrictions-for-v3-aws-k8s-projects). ## Test plan - [x] `tsc --noEmit` passes for the changed file - [x] `eslint` passes for the changed file - [x] `prettier --check` passes for the changed file - [x] Mirrors the existing, already-shipped High Availability disabled-section pattern in the same component 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Summary by CodeRabbit * **Behavior Changes** * Network restrictions are unavailable for AWS Kubernetes and High Availability projects, and for users without update permission. AWS Kubernetes projects display a dedicated explanation; restriction details and management controls are hidden. --- .../NetworkRestrictions.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx index 9c35cc0edcd..d6112f596ea 100644 --- a/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx +++ b/apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx @@ -14,6 +14,7 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from 'ui' +import { Admonition } from 'ui-patterns/Admonition' import { PageSection, PageSectionAside, @@ -34,12 +35,13 @@ import { HighAvailabilityDisabledSectionNotice } from '@/components/ui/HighAvail import { useNetworkRestrictionsQuery } from '@/data/network-restrictions/network-restrictions-query' import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions' import { useHighAvailability } from '@/hooks/misc/useHighAvailability' -import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' +import { useIsAwsK8sCloudProvider, useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' import { DOCS_URL } from '@/lib/constants' const HA_DISABLED_TITLE = 'Network restrictions unavailable on High Availability projects' const HA_DISABLED_DESCRIPTION = "We're working to bring network restrictions to High Availability projects. Contact support if this is blocking your work." +const AWS_K8S_DISABLED_TITLE = 'Network restrictions are not yet supported on this project' interface AccessButtonProps { disabled: boolean @@ -84,6 +86,7 @@ export const NetworkRestrictions = () => { const { ref } = useParams() const { data: project } = useSelectedProjectQuery() const { isHighAvailability } = useHighAvailability() + const isAwsK8s = useIsAwsK8sCloudProvider() const [isAddingAddress, setIsAddingAddress] = useState() const [isAllowingAll, setIsAllowingAll] = useState(false) const [isDisallowingAll, setIsDisallowingAll] = useState(false) @@ -103,10 +106,12 @@ export const NetworkRestrictions = () => { } ) - const isSectionDisabled = isHighAvailability || !canUpdateNetworkRestrictions + const isSectionDisabled = isHighAvailability || isAwsK8s || !canUpdateNetworkRestrictions const sectionDisabledReason = isHighAvailability ? HA_DISABLED_TITLE - : 'You need additional permissions to update network restrictions' + : isAwsK8s + ? AWS_K8S_DISABLED_TITLE + : 'You need additional permissions to update network restrictions' const hasAccessToRestrictions = data?.entitlement === 'allowed' const ipv4Restrictions = data?.config?.dbAllowedCidrs ?? [] @@ -131,7 +136,7 @@ export const NetworkRestrictions = () => { - {!canUpdateNetworkRestrictions || isHighAvailability ? ( + {isSectionDisabled ? ( { /> )} + {!isHighAvailability && isAwsK8s && ( +
+ +
+ )} {!isHighAvailability && + !isAwsK8s && (isLoading ? (