Skip to content

ark status hardcodes namespace fallback to 'default' — clusterInfo.namespace is never populated #3306

Description

@ciassj

Component: tools/ark-cli

Description:

ark status's per-service namespace resolution (src/components/statusChecker.ts) is:

// Use service namespace if defined, otherwise use current namespace from clusterInfo
const namespace = service.namespace || clusterInfo?.namespace || 'default';

This assumes clusterInfo.namespace holds the user's actual current kubectl-context namespace. It never does. clusterInfo is populated in src/lib/startup.ts:

config.clusterInfo = {
type: 'unknown', // We don't detect cluster type here - too slow
context: stdout.trim(),
// We don't fetch namespace or cluster details here - too slow
};

Only .context is ever set; .namespace is never assigned anywhere in the codebase. So for every service without a hardcoded namespace override in arkServices.ts (ark-api, ark-dashboard, ark-mcp, ark-broker, file-gateway, noah, kubernetes-mcp-server), the fallback always resolves to the literal 'default', regardless of the user's real kubectl context namespace — even after explicitly running kubectl config set-context --current --namespace=.

Impact: ark status is unusable for any tenant not literally named default — every non-ark-system-scoped service reports unhealthy with a Forbidden error (the user's RBAC correctly doesn't extend to the unrelated default namespace), even when the actual deployment is healthy in the user's real namespace. There is also no --namespace flag on ark status to override this.

Steps to reproduce:

  1. Install ARK in any namespace other than default (standard tenant-provisioning flow).
  2. Run kubectl config set-context --current --namespace= (to point kubectl at the right namespace).
  3. Run ark status.
  4. Observe every non-ark-system service report Forbidden ... in the namespace "default", despite step 2.

Expected behavior: ark status should check services in the user's actual current namespace (or accept an explicit --namespace flag), consistent with other commands like ark agents/ark models, which correctly reflect the real tenant namespace.

Suggested fix: In startup.ts, actually populate clusterInfo.namespace — e.g. via kubectl config view --minify -o jsonpath='{..namespace}' (same fast, local-only check pattern already used for hasKubernetesContext()) — instead of leaving the field permanently unset. Alternatively/additionally, add a --namespace flag to ark status for explicit override.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions