Skip to content

PLATENG-137: Go port of bonfire_lib — ephemeral namespace and cluster reservation lifecycle#596

Draft
ritmun wants to merge 1 commit into
RedHatInsights:masterfrom
ritmun:PLATENG-137-phase-1
Draft

PLATENG-137: Go port of bonfire_lib — ephemeral namespace and cluster reservation lifecycle#596
ritmun wants to merge 1 commit into
RedHatInsights:masterfrom
ritmun:PLATENG-137-phase-1

Conversation

@ritmun

@ritmun ritmun commented Jul 1, 2026

Copy link
Copy Markdown

Summary

This PR is Phase 1 of a 4-phase effort to port bonfire from Python to Go, removing the Python runtime and `oc` binary dependencies.

  • Phase 1 (this PR) — `go/pkg/ephemeral`: Go library replacing `bonfire_lib` — namespace and cluster reservation lifecycle via `client-go`, no `oc` or Python required
  • Phase 2 — `go/pkg/mcp` + `cmd/bonfire-mcp`: Go MCP server binary replacing `bonfire_mcp`, single static binary with no runtime deps
  • Phase 3 — `cmd/bonfire`: CLI namespace/cluster commands (reserve, release, extend, describe, pool list) without `oc`
  • Phase 4 — Full deploy pipeline: OpenShift Template processing via `openshift/library-go` (native, no `oc process`), qontract GraphQL client, `bonfire deploy` end-to-end

Full roadmap with checklist: `go/AGENTS.md`.

What's in scope (Phase 1)

  • `k8s_client.go` — `EphemeralK8sClient` with DynamicClient + CoreV1 ops, 3 auth modes (token / in-cluster / kubeconfig)
  • `reservations.go` — `Reserve`, `Release`, `Extend`
  • `clusters.go` — `ReserveCluster`, `ReleaseCluster`, `ExtendCluster`, `GetClusterStatus`, `GetKubeconfig`
  • `pools.go` — `ListPools`, `ListClusterPools`, `GetPoolCapacity`
  • `status.go` — `GetReservation`, `ListReservations`, `WaitOnReservation`, `DescribeNamespace`
  • `config.go`, `utils.go` — settings and shared utilities
  • `client_iface.go` — `Client` interface enabling cluster-free unit tests
  • 67 table-driven unit tests, no live cluster required

Test plan

  • `cd go && go build ./...` passes
  • `cd go && go test ./pkg/ephemeral/... -v` — all 67 tests pass
  • Manual smoke test against a real cluster (namespace reserve/release cycle)

🤖 Generated with Claude Code

… reservation lifecycle

Adds go/pkg/ephemeral, a Go library replacing bonfire_lib with no Python runtime
or oc binary dependency. Supports namespace and cluster reservation lifecycle
(reserve, release, extend, describe), pool listing, and status queries against
cloud.redhat.com/v1alpha1 CRDs via client-go with three auth modes
(token, in-cluster, kubeconfig). Includes 67 table-driven unit tests
requiring no live cluster.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: d22ff11d-6cfd-4b4b-84ee-c953b420f463

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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