Documentation
¶
Overview ¶
Package config resolves the environment ate-setup installs into. It layers the developer's .ate-dev-env.sh (sourced through bash, so existing setups keep working), the ambient process environment, and command line flags into a single typed Config.
Index ¶
- Constants
- func RepoRoot() (string, error)
- type Config
- func (c *Config) EnsureClusterCredentials(ctx context.Context) error
- func (c *Config) KoEnv() []string
- func (c *Config) Manifest(parts ...string) string
- func (c *Config) Path(parts ...string) string
- func (c *Config) PostgresConnString() string
- func (c *Config) PostgresSchemaName() string
- func (c *Config) ScriptEnv() []string
- func (c *Config) WaitTimeout(historical time.Duration) time.Duration
- type Options
Constants ¶
const ( RouterEnvoy = "envoy" RouterAgentgateway = "agentgateway" SandboxClassGvisor = "gvisor" SandboxClassMicrovm = "microvm" )
Enumerated values for the install-shaping flags.
const DefaultPostgresConnectionString = "" /* 262-byte string literal not displayed */
DefaultPostgresConnectionString mirrors default_postgres_connection_string in the shell installer: the apiserver reaches PostgreSQL over mTLS using the podcertificate controller's projected servicedns trust bundle and its own podidentity credential bundle.
const DefaultPostgresSchema = "public"
DefaultPostgresSchema mirrors the shell installer's default for ATE_API_POSTGRES_SCHEMA, the PostgreSQL schema holding the Substrate tables.
const DefaultRolloutTimeout = 60 * time.Second
DefaultRolloutTimeout is the default wait timeout for workload rollouts.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Root is the repository root. All manifest paths are relative to it.
Root string
// Kind selects the local Kind install profile (ATE_INSTALL_KIND).
Kind bool
// Kubeconfig and Context select the target cluster. Empty Context means
// "use the current context" (the KUBECTL_CONTEXT convention).
//
// Kubeconfig falls back to $KUBECONFIG rather than staying empty. The
// client-go loading rules consult that variable on their own, so leaving
// it out here would point ate-setup at one cluster while the shell scripts
// it delegates to, which are handed this value through ScriptEnv, used
// another.
Kubeconfig string
Context string
// GKE cluster coordinates, used to fetch credentials and to derive the
// service account JWT issuer.
ProjectID string
ClusterName string
ClusterLocation string
// BucketName is the snapshot bucket demos are templated with.
BucketName string
// KODockerRepo is where ko pushes images (KO_DOCKER_REPO).
KODockerRepo string
// KODefaultPlatforms constrains ko's build platforms.
KODefaultPlatforms string
// Images selects where container images come from. Its zero value builds
// them from source with ko, which is what a developer install does.
Images images.Source
// Router selects the atenet router dataplane.
Router string
// PostgresConnectionString is the apiserver's store connection string.
// Empty means use DefaultPostgresConnectionString.
PostgresConnectionString string
// PostgresSchema is the PostgreSQL schema for the Substrate tables
// (ATE_API_POSTGRES_SCHEMA). Empty means DefaultPostgresSchema.
PostgresSchema string
// RolloutTimeout is the timeout duration for rollout status checks.
RolloutTimeout time.Duration
// PodcertWorkersPerSigner overrides WORKERS_PER_SIGNER on podcertificate-controller.
PodcertWorkersPerSigner int
// ExperimentalUseSDSMint enables per-SNI dynamic cert minting on atenet-egress.
ExperimentalUseSDSMint bool
// AdditionalEgressExtprocService is the optional NS/SVC:PORT external processor filter.
AdditionalEgressExtprocService string
// AnthropicAPIKey is required only by the claude-code-multiplex demo.
AnthropicAPIKey string
// OtlpEndpoint is where the control plane ships telemetry
// (ATE_OTLP_ENDPOINT). Benchmark actors are pointed at it too.
OtlpEndpoint string
// BenchmarkActorMemory is the memory limit for benchmark actors
// (BENCHMARK_ACTOR_MEMORY). Empty leaves the workload default in place.
BenchmarkActorMemory string
// contains filtered or unexported fields
}
Config is the fully resolved installation environment. Fields sourced from the developer environment keep their shell names in the comments so the mapping back to .ate-dev-env.sh stays obvious.
func Load ¶
Load resolves the effective configuration. Precedence, lowest to highest: .ate-dev-env.sh, the process environment, then flags.
func (*Config) EnsureClusterCredentials ¶
EnsureClusterCredentials fetches GKE credentials when the configuration names a project but no explicit context.
This reproduces the prologue of the shell installer: a developer whose .ate-dev-env.sh sets PROJECT_ID gets their kubeconfig populated before anything talks to the cluster. Setting a context (or KUBECTL_CONTEXT) is taken as "I already have credentials" and skips the call, as it did there.
func (*Config) PostgresConnString ¶
PostgresConnString returns the configured connection string, falling back to the in-cluster default.
func (*Config) PostgresSchemaName ¶
PostgresSchemaName returns the configured schema, falling back to the shell installer's default. ate-api-server rejects an empty value.
func (*Config) ScriptEnv ¶
ScriptEnv returns the environment for the shell scripts ate-setup still delegates to (the benchmark and micro-VM helpers).
Those scripts read the same variables the shell installer exported to them, so this reproduces that environment: .ate-dev-env.sh under the process environment, with the resolved configuration layered on top so that flags such as --context and --kind reach them.
func (*Config) WaitTimeout ¶
WaitTimeout returns how long to wait for a workload whose historical timeout was historical.
The shell installer applied --rollout-timeout to the ate-system rollouts only; the podcertificate-controller wait and the CSI driver waits were fixed at 120s because they are the slow bootstrap paths — an image pull on a cold cluster, in the CSI case a driver being torn down and reinstalled. Honoring the flag everywhere would let its 60s default halve exactly those waits.
So the flag now reaches every wait, but only when someone asked for it. Left alone, each site keeps the timeout the scripts gave it.
type Options ¶
type Options struct {
Kind bool
Kubeconfig string
Context string
Router string
RolloutTimeout string
PodcertWorkersPerSigner int
ExperimentalUseSDSMint bool
AdditionalEgressExtprocService string
// Image source selection.
ImageRepo string
ImageTag string
// NoDevEnv skips sourcing .ate-dev-env.sh even when it exists.
NoDevEnv bool
}
Options carries the raw flag values the root command collects, before defaulting and validation.