MCPcopy Create free account
hub / github.com/PostHog/duckgres / parseNodeSelector

Function parseNodeSelector

controlplane/multitenant.go:666–676  ·  view source on GitHub ↗

parseNodeSelector parses a JSON string into a map[string]string. Returns nil if the input is empty or invalid.

(s string)

Source from the content-addressed store, hash-verified

664 readOnlyTokens := admin.NewTokenSet(cfg.ReadOnlySecret, cfg.ReadOnlySecretFallbacks)
665 trinoServiceAuthCells, err := trinoCells.loadTrinoServiceAuthCells(adminTokens, readOnlyTokens)
666 if err != nil {
667 return nil, nil, nil, nil, nil, nil, err
668 }
669 if readOnlyTokens.Count() == 0 {
670 // Keyed off the TokenSet, not just cfg.ReadOnlySecret: fallbacks
671 // alone (mid-rotation) still validate, and saying otherwise here
672 // would mislead an operator debugging exactly that state.
673 slog.Info("Read-only secret not set; discovery endpoints accept only the internal secret. Set --read-only-secret or DUCKGRES_READ_ONLY_SECRET to give external writers a scoped credential.")
674 } else if n := len(cfg.ReadOnlySecretFallbacks); n > 0 {
675 // Count only — never log the secret values.
676 slog.Info("Discovery secret rotation fallbacks active.", "fallback_count", n)
677 }
678
679 // Set up API server (admin + provisioning + dashboard on :8080).

Callers 2

TestParseNodeSelectorFunction · 0.85
SetupMultiTenantFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestParseNodeSelectorFunction · 0.68