mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 14:02:56 +09:00
fix(dashboard): gate options query on tenant namespace
Address review feedback from gemini-code-assist on DynamicOptionsWidget.tsx: gate the useK8sList options query with enabled: !!tenantNamespace so it does not fire a cluster-wide request to core.cozystack.io options (403 for non-admin tenants) while the tenant namespace is still resolving. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
1 parent
2c4b936690
commit
d4b0b527ba
1 file changed
+9
-6
+9
-6
@@ -40,12 +40,15 @@ export function DynamicOptionsWidget(props: WidgetProps) {
|
||||
"x-cozystack-options"
|
||||
]?.source
|
||||
|
||||
const { data: optionList, isLoading } = useK8sList<OptionObject>({
|
||||
apiGroup: "core.cozystack.io",
|
||||
apiVersion: "v1alpha1",
|
||||
plural: "options",
|
||||
namespace: tenantNamespace ?? undefined,
|
||||
})
|
||||
const { data: optionList, isLoading } = useK8sList<OptionObject>(
|
||||
{
|
||||
apiGroup: "core.cozystack.io",
|
||||
apiVersion: "v1alpha1",
|
||||
plural: "options",
|
||||
namespace: tenantNamespace ?? undefined,
|
||||
},
|
||||
{ enabled: !!tenantNamespace },
|
||||
)
|
||||
|
||||
const items: OptionItem[] =
|
||||
optionList?.items?.find((o) => o.metadata.name === source)?.spec?.items ?? []
|
||||
|
||||
Reference in new issue
Block a user