refactor(cardanonetwork)!: delete the in-cluster faucet service#108
Merged
Conversation
P4b of the faucet-removal re-architecture (completes P4). Removes the in-cluster faucet HTTP service entirely; the genesis-funded `faucet` wallet is now created for every local network (gated on local mode alone) and is the network's funded wallet, spent from host-side via `yacd wallet topup`. BREAKING CHANGE: removes spec.chainAPI.faucet, status.faucet, the faucet endpoint, and the FaucetReady condition from the CardanoNetwork CRD. Pre-1.0; devnets are ephemeral. - delete services/faucet/, the faucet image (release.yml jobs, Tiltfile, ko-build-faucet.sh, --default-faucet-image flag, chart faucet.image + kyverno), and the CLI embedded-chart faucet image plumbing - delete controller faucet-service wiring: faucet_auth.go, faucet_auth_watch.go, faucetContainer, source-address init, faucet Service/auth Secret, FaucetReady, revokePrimaryFaucetExposure, faucet readiness/status/conditions/defaults, the faucet port-conflict branch, and primarypod faucet port - re-gate the genesis faucet wallet to local-mode-only (builder.go) - CLI: drop the faucet trust-gate residue (faucetTokenForHost, YACD_FAUCET_*, endpoints FaucetURL, info/list faucet, ConditionFaucetReady, devconfig faucet validation) - rewrite the Chainsaw smoke (drop the faucet HTTP test; assert only the faucet wallet Secret + kupo-disable teardown); fix the orphaned dbsync port-conflict test - regenerate CRD/deepcopy/mocks; examples + embedded yamls drop chainAPI.faucet Manager dependency boundary preserved (./cmd pulls no ogmigo/kugo/Apollo tx-builder). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
P4b of the faucet-removal re-architecture (completes P4, follows merged PR-4a #107). This deletes the in-cluster faucet HTTP service entirely. The genesis-funded
faucetwallet (Secret<net>-wallet-faucet) stays and is now the network's funded wallet, spent from host-side viayacd wallet topup … --from faucet(delivered in P3 #106).After PR-4a the controller no longer called the faucet service; this PR removes the now-dead service and its entire build/release/CLI surface, plus the one behavioral change that matters: re-gating the genesis faucet wallet on local mode alone.
Breaking change
Removes from the
CardanoNetworkCRD:spec.chainAPI.faucet,status.faucet, the faucet endpoint, and theFaucetReadycondition. Pre-1.0; devnets are ephemeral; no conversion webhook.What changed
The re-gate (highest-risk edit):
faucetWalletEnabled/resolveFaucetWalletSettingsnow gate the genesis faucet wallet onSpec.Mode == Localalone (dropped the oldfaucet.enableddependency). Wrong here = a fresh devnet boots with no funding source.Deleted:
services/faucet/(whole tree), the faucet image (release.yml jobs, Tiltfile,ko-build-faucet.sh,--default-faucet-imageflag, chartfaucet.image+ kyverno entry), and the CLI embedded-chart faucet image plumbing.faucet_auth.go,faucet_auth_watch.go,faucetContainer, source-address init, faucet Service/auth Secret,FaucetReady,revokePrimaryFaucetExposure, faucet readiness/status/conditions/defaults, the faucet port-conflict branch, and the primarypod faucet port.faucetTokenForHost,YACD_FAUCET_*, endpointsFaucetURL, info/list faucet sections,ConditionFaucetReady, devconfig faucet validation.FaucetSpec/FaucetStatus/ChainAPISpec.Faucet/status.Faucet/endpoints.Faucet/FaucetReady.Tests: rewrote the Chainsaw smoke (dropped the faucet HTTP curl test; asserts the
<net>-wallet-faucetSecret + a non-empty address, and that the wallet survives a chain-API toggle; teardown disables kupo only); fixed the orphaned dbsync port-conflict test (8080 freed). Added a direct-reconcileTestCardanoNetworkReconcilerReconcileGatesFaucetWalletOnLocalMode(local → wallet Secret present, public → absent).88 files, +268 / −7653(bulk is theservices/faucet/deletion).Validation
root:check(gofmt, lint, generated-artifacts guard, helm, chainsaw-lint)root:test(envtest + unit), incl. the new re-gate reconcile testroot:test-e2e(real Kind/Chainsaw): local network boots with no faucet service, the genesis faucet wallet Secret exists with a funded address, survives a kupo-disable patch, and the network reaches Readygo list -deps ./cmdfree of ogmigo/kugo/Apollo-tx-builder (only Apollo address/key subpackages)*-keysgenesis artifacts, and P5-deferred doc prose remainAdversarial review
A multi-agent review (6 dimensions, each finding independently verified) surfaced 3 findings; all dispositioned:
Owns()watch — dismissed. On master the only Secret watch (faucetAuthSecretEventPredicate) matched-faucet-authand deliberately excluded the wallet Secret; this PR doesn't regress it. Watching is wrong by design — the wallet is create-once genesis-funded key material, and recreating it on external delete would mint an unfunded address.list;watchon secrets now unused — actioned (per-controller marker only). Tightened thecardanonetworkmarker toget;create;patch;delete(its only Secret informer is gone). The shared manager ClusterRole is unchanged — it's the controller-gen union andcardanodbsynclegitimately needs Secretlist;watch(Owns(&Secret)+ a SecretWatcheshandler), so the role can't shrink without splitting ClusterRoles (out of scope).TestManagerRBACMatchesControllerGengreen.kubectl get secret <net>-wallet-faucetcheck after the kupo-disable patch.Not done here (P5)
yacd devnetend-to-end is P5-gated).DESIGN.md,README.md,docs/host-access.md,containers/cardano-testnet/README.md) still describe the faucet service — intentionally deferred to P5 / docs PR docs: add MkDocs documentation site with Diátaxis structure #91.yacd wallet topup --from faucetwas not run: the running dev stack is bound to the now-merged 4a worktree (pre-4b code), and re-pointing it requires a disruptive teardown. Chainsaw already proves the re-gate in a real cluster, and the topup path is unchanged P3 code. Can run it on request before merge.🤖 Generated with Claude Code