Skip to content

feat: namespace flag, tenant labels, scoped RBAC, dtach in init container#1

Merged
pdettori merged 3 commits intomainfrom
mvp
Apr 28, 2026
Merged

feat: namespace flag, tenant labels, scoped RBAC, dtach in init container#1
pdettori merged 3 commits intomainfrom
mvp

Conversation

@pdettori
Copy link
Copy Markdown

Summary

Adapts the forked openshell-driver-openshift for multi-tenant MVP — addresses all four changes from kagenti/kagenti#1354.

  • Namespace from config: --namespace flag was already present; driver targets one namespace per tenant
  • Tenant labels: new --tenant flag (defaults to namespace value) injects openshell.ai/tenant and kagenti.io/team labels on Sandbox CRs and pod template metadata
  • dtach in init container: init container command changed from cp to sh -c "cp supervisor && cp dtach" so both binaries land in the shared emptyDir volume; configurable via --dtach-binary-path
  • Scoped RBAC: deploy/gateway-with-driver.yaml replaces ClusterRoleBinding + cluster-admin with namespace-scoped Role + RoleBinding; all namespace references parameterized via ${NAMESPACE} for envsubst

Acceptance criteria

  • --namespace team1 flag targets sandbox creation to team1 namespace only
  • Sandbox pods have openshell.ai/tenant and kagenti.io/team labels
  • RBAC manifest uses namespace-scoped Role, not ClusterRole
  • Init container copies both openshell-sandbox and dtach binaries

Test plan

  • All existing unit tests pass (go test ./...)
  • TestDefaultConfig updated to verify DtachBinaryPath default
  • TestBuildSandboxSpec_SupervisorInitContainer updated to verify sh -c command includes both binary paths
  • TestBuildSandboxSpec_Labels updated to assert no tenant labels when Tenant is empty
  • TestBuildSandboxSpec_TenantLabels added — verifies openshell.ai/tenant and kagenti.io/team are set when cfg.Tenant = "team1"

🤖 Generated with Claude Code

- Add kagenti-ci.yml workflow with Go build, golangci-lint, and
  unit/gRPC test jobs on ubuntu-latest
- Triggers on PRs to main/mvp and pushes to mvp
- Update README with fork notice and upstream tracking info

Closes kagenti/kagenti#1352

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
- Replace empty error branch with explicit discard in contract_test.go
- Increase golangci-lint timeout to 5m (default 1m was insufficient)

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
…iner

Adapts the forked openshell-driver-openshift for multi-tenant MVP:

- --namespace flag: already present; --tenant flag added (defaults to
  namespace value) to set openshell.ai/tenant and kagenti.io/team labels
  on all sandbox CR metadata and pod template labels
- dtach binary: init container command updated to sh -c so it copies
  both openshell-sandbox and dtach from the supervisor image into the
  shared emptyDir volume; --dtach-binary-path flag configures the source
  path (default: /usr/local/bin/dtach)
- Scoped RBAC: deploy/gateway-with-driver.yaml replaces the cluster-admin
  ClusterRoleBinding with a namespace-scoped Role + RoleBinding; all
  namespace references parameterized via ${NAMESPACE} envsubst variable

Closes #1354

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori merged commit d482236 into main Apr 28, 2026
7 checks passed
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