From bded9a1ee081beb1edd3a45452572db8b02482d2 Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Fri, 17 Jul 2026 22:31:16 +1000 Subject: [PATCH] cbt: address devnet CBT instances by their analytics ingress host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Devnet networks have no cbt..ethpandaops.io DNS record — the per-devnet wildcard resolves to the devnet fleet's own ingress, so the convention host 404s for every devnet. The per-devnet CBT instances the mca-devnets ApplicationSet deploys are reachable at -xatu-cbt.analytics.production.platform.ethpandaops.io, derived from the network name alone, so route *-devnet-* networks there. --- modules/cbt/module.go | 17 +++++++++++---- modules/cbt/module_test.go | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 modules/cbt/module_test.go diff --git a/modules/cbt/module.go b/modules/cbt/module.go index 416a01fb..03e0330a 100644 --- a/modules/cbt/module.go +++ b/modules/cbt/module.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "maps" + "strings" "github.com/ethpandaops/panda/pkg/cartographoor" "github.com/ethpandaops/panda/pkg/module" @@ -32,10 +33,18 @@ func New() *Module { return &Module{} } -// NetworkBaseURL returns the CBT instance base URL for a network, derived from -// the standard ethpandaops.io naming convention. Cartographoor discovery does -// not expose a CBT service URL, so the per-network host is derived here. +// NetworkBaseURL returns the CBT instance base URL for a network. Cartographoor +// discovery does not expose a CBT service URL, so the per-network host is +// derived here. Named networks follow the cbt..ethpandaops.io +// convention. Devnets have no such record — their wildcard DNS points at the +// devnet fleet's own ingress, not the cluster hosting CBT — so their instances +// are addressed by the analytics ingress host the mca-devnets ApplicationSet +// provisions per devnet. func NetworkBaseURL(network string) string { + if strings.Contains(network, "-devnet-") { + return fmt.Sprintf("https://%s-xatu-cbt.analytics.production.platform.ethpandaops.io", network) + } + return fmt.Sprintf("https://cbt.%s.ethpandaops.io", network) } @@ -55,7 +64,7 @@ func (m *Module) Validate() error { // SandboxEnv returns environment variables for the sandbox. // Returns ETHPANDAOPS_CBT_NETWORKS with network->URL mapping derived from -// cartographoor active networks using the convention https://cbt.{network}.ethpandaops.io. +// cartographoor active networks via NetworkBaseURL. func (m *Module) SandboxEnv() (map[string]string, error) { if m.cartographoorClient == nil { return nil, nil diff --git a/modules/cbt/module_test.go b/modules/cbt/module_test.go new file mode 100644 index 00000000..3d4c0768 --- /dev/null +++ b/modules/cbt/module_test.go @@ -0,0 +1,42 @@ +package cbt + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestNetworkBaseURL(t *testing.T) { + tests := []struct { + name string + network string + want string + }{ + { + name: "named network uses vanity host", + network: "mainnet", + want: "https://cbt.mainnet.ethpandaops.io", + }, + { + name: "hoodi uses vanity host", + network: "hoodi", + want: "https://cbt.hoodi.ethpandaops.io", + }, + { + name: "glamsterdam devnet uses analytics ingress host", + network: "glamsterdam-devnet-7", + want: "https://glamsterdam-devnet-7-xatu-cbt.analytics.production.platform.ethpandaops.io", + }, + { + name: "bal devnet uses analytics ingress host", + network: "bal-devnet-7", + want: "https://bal-devnet-7-xatu-cbt.analytics.production.platform.ethpandaops.io", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, NetworkBaseURL(tt.network)) + }) + } +}