Skip to content

Fix namespace resolution in restoresession editor options - #1139

Merged
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-rs-ns-scope
Aug 13, 2026
Merged

Fix namespace resolution in restoresession editor options#1139
ArnobKumarSaha merged 1 commit into
masterfrom
arnob-rs-ns-scope

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

getRepositories and setSecurityContext both read the namespace from /route/query/namespace only. That query param is absent on the /restoresessions/create route, so:

  • for a namespace-scoped org (orgType === 3) the repository list requested .../namespaces//repositories and returned nothing;
  • the OpenShift sa.scc.uid-range lookup was silently skipped.

The other two entry points (/mongodbs/<db>/backup?namespace= and /operations/create-restoresession?namespace=) carry the param, which is why only the direct create route was broken.

Both now resolve the namespace through resolveNamespace(): route query → /metadata/release/namespace in the model → the single namespace granted by the SelfSubjectNamespaceAccessReview (fetchNamespacesApi, already cached in init). The cluster-scoped repository list is unchanged for full-access orgs.

create-ui.yaml: the Repository loader and setSecurityContext now watch metadata/release/namespace, since in the console flow initMetadata runs before the user picks a namespace.

Snapshots needed no change — getSnapshots already scopes to the selected repository's own namespace. Addons stay cluster-scoped (Addon is scope: Cluster).

The repository list and the OpenShift uid-range lookup both read the
namespace from /route/query/namespace only. That query param is absent on
the /restoresessions/create route, so a namespace-scoped org (orgType 3)
requested .../namespaces//repositories and the security context was never
set.

Resolve the namespace from the route query, then the release namespace in
the model, then the single namespace granted by the access review, and
refetch both when the namespace picker changes.

Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit b9b4ef6 into master Aug 13, 2026
4 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the arnob-rs-ns-scope branch August 13, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant