Skip to content

Commit b5092f1

Browse files
Merge pull request #711 from lionelvillard/viper
cleanup: use viper to handle config priority
2 parents edb98b9 + d95b332 commit b5092f1

File tree

10 files changed

+262
-411
lines changed

10 files changed

+262
-411
lines changed

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ There are 3 main types of documentation targeting different audiences:
6868
## E2E Testing
6969

7070
- use make targets for running e2e tests (e.g., `make test-e2e`) and document the process in `docs/developer-guide/testing.md`
71+
- use `make test` for unit tests
7172
- **Never use images from docker.io in e2e tests.** All container images must use fully-qualified registry paths (e.g., `registry.k8s.io/`, `quay.io/`, or a private registry). Do not rely on Docker Hub as a default registry.
7273

7374
## CLI Tools

cmd/main.go

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -169,32 +169,10 @@ func main() {
169169
os.Exit(1)
170170
}
171171

172-
// Create StaticConfigFlags from parsed flags
173-
// For boolean and duration flags, pass pointers to distinguish "unset" from "explicitly set"
174-
flags := config.StaticConfigFlags{
175-
MetricsAddr: metricsAddr,
176-
ProbeAddr: probeAddr,
177-
EnableLeaderElection: &enableLeaderElection,
178-
LeaderElectionID: "72dd1cf1.llm-d.ai", // Default, can be overridden via env/ConfigMap
179-
LeaseDuration: &leaseDuration,
180-
RenewDeadline: &renewDeadline,
181-
RetryPeriod: &retryPeriod,
182-
RestTimeout: &restTimeout,
183-
SecureMetrics: &secureMetrics,
184-
EnableHTTP2: &enableHTTP2,
185-
WatchNamespace: watchNamespace,
186-
LoggerVerbosity: loggerVerbosity,
187-
WebhookCertPath: webhookCertPath,
188-
WebhookCertName: webhookCertName,
189-
WebhookCertKey: webhookCertKey,
190-
MetricsCertPath: metricsCertPath,
191-
MetricsCertName: metricsCertName,
192-
MetricsCertKey: metricsCertKey,
193-
}
194-
195172
// Load unified configuration (fail-fast if invalid)
173+
// Viper resolves precedence: flags > env > ConfigMap > defaults
196174
ctx := context.Background()
197-
cfg, err := config.Load(ctx, flags, tempClient)
175+
cfg, err := config.Load(ctx, flag.CommandLine, tempClient)
198176
if err != nil {
199177
setupLog.Error(err, "failed to load configuration - this is a fatal error")
200178
os.Exit(1)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Unified Configuration System
2+
3+
WVA uses a unified configuration system that consolidates all settings into a single `Config` structure. This provides clear precedence rules, type safety, and separation between static (immutable) and dynamic (runtime-updatable) configuration.
4+
5+
### Configuration Structure
6+
7+
The unified `Config` consists of two parts:
8+
9+
1. **StaticConfig**: Immutable settings loaded at startup (require controller restart to change)
10+
- Infrastructure settings (metrics/probe addresses, leader election)
11+
- Connection settings (Prometheus URL, TLS certificates)
12+
- Feature flags
13+
14+
2. **DynamicConfig**: Runtime-updatable settings (can be changed via ConfigMap updates)
15+
- Optimization interval
16+
- Saturation scaling thresholds
17+
- Scale-to-zero configuration
18+
- Prometheus cache settings

docs/user-guide/configuration.md

Lines changed: 54 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -126,79 +126,34 @@ See [Saturation Analyzer Documentation](../../docs/saturation-analyzer.md) for c
126126

127127
WVA uses ConfigMaps for cluster-wide configuration.
128128

129-
### Service Class ConfigMap
130-
131-
Defines SLO requirements for different service tiers:
132-
133-
```yaml
134-
apiVersion: v1
135-
kind: ConfigMap
136-
metadata:
137-
name: serviceclass
138-
namespace: workload-variant-autoscaler-system
139-
data:
140-
serviceClasses: |
141-
- name: Premium
142-
model: meta/llama-3.1-8b
143-
priority: 1
144-
slo-itl: 24 # Time per output token (ms)
145-
slo-ttw: 500 # Time to first token (ms)
146-
147-
- name: Standard
148-
model: meta/llama-3.1-8b
149-
priority: 5
150-
slo-itl: 50
151-
slo-ttw: 1000
152-
153-
- name: Freemium
154-
model: meta/llama-3.1-8b
155-
priority: 10
156-
slo-itl: 100
157-
slo-ttw: 2000
158-
```
159-
160-
## Unified Configuration System
161-
162-
WVA uses a unified configuration system that consolidates all settings into a single `Config` structure. This provides clear precedence rules, type safety, and separation between static (immutable) and dynamic (runtime-updatable) configuration.
163-
164-
### Configuration Structure
165-
166-
The unified `Config` consists of two parts:
167-
168-
1. **StaticConfig**: Immutable settings loaded at startup (require controller restart to change)
169-
- Infrastructure settings (metrics/probe addresses, leader election)
170-
- Connection settings (Prometheus URL, TLS certificates)
171-
- Feature flags
172-
173-
2. **DynamicConfig**: Runtime-updatable settings (can be changed via ConfigMap updates)
174-
- Optimization interval
175-
- Saturation scaling thresholds
176-
- Scale-to-zero configuration
177-
- Prometheus cache settings
178-
179129
### Configuration Precedence
180130

181-
Configuration values are loaded with the following precedence (highest to lowest):
131+
Configuration values are resolved with following precedence (highest to lowest):
182132

183-
1. **CLI Flags** (highest priority)
133+
1. **CLI Flags** — only when explicitly set on the command line (highest priority)
184134
2. **Environment Variables**
185135
3. **ConfigMap** (in `workload-variant-autoscaler-system` namespace)
186136
4. **Defaults** (lowest priority)
187137

138+
> **Note:** CLI flag defaults do **not** override environment variables or ConfigMap values.
139+
> Only flags that are explicitly passed on the command line take precedence.
140+
> For example, if `--leader-elect` is not passed but `LEADER_ELECT=true` is set in
141+
> the environment, the environment value (`true`) is used.
142+
188143
**Example:**
189144
```bash
190-
# CLI flag (highest priority)
191-
--metrics-addr=":8443"
145+
# CLI flag explicitly set (highest priority)
146+
--metrics-bind-address=":8443"
192147
193-
# Environment variable (overridden by flags)
148+
# Environment variable (used when flag is not explicitly set)
194149
export METRICS_BIND_ADDRESS=":8080"
195150
196-
# ConfigMap (overridden by env/flags)
151+
# ConfigMap (used when neither flag nor env is set)
197152
# wva-variantautoscaling-config
198153
data:
199154
METRICS_BIND_ADDRESS: ":9090"
200155
201-
# Default (used if none of above are set)
156+
# Default (used if none of the above are set)
202157
# Default: "0" (disabled)
203158
```
204159

@@ -457,10 +412,10 @@ metadata:
457412
data:
458413
# Mutable: Optimization interval (can be changed at runtime)
459414
GLOBAL_OPT_INTERVAL: "60s"
460-
415+
461416
# Immutable: Prometheus connection (requires restart if changed)
462417
PROMETHEUS_BASE_URL: "https://prometheus:9090"
463-
418+
464419
# Immutable: Feature flags (require restart if changed)
465420
WVA_SCALE_TO_ZERO: "true"
466421
WVA_LIMITED_MODE: "false"
@@ -478,11 +433,11 @@ env:
478433
# Prometheus connection (immutable - requires restart to change)
479434
- name: PROMETHEUS_BASE_URL
480435
value: "https://prometheus:9090"
481-
436+
482437
# Optional: Override ConfigMap name
483438
- name: CONFIG_MAP_NAME
484439
value: "my-custom-config"
485-
440+
486441
# Optional: Override namespace
487442
- name: POD_NAMESPACE
488443
value: "workload-variant-autoscaler-system"
@@ -492,19 +447,51 @@ env:
492447

493448
### Configuration via CLI Flags
494449

495-
Infrastructure settings can be configured via CLI flags (highest precedence):
450+
Infrastructure settings can be configured via CLI flags. Only flags explicitly passed on the command line take highest precedence; unset flags fall through to environment variables, ConfigMap, and then defaults.
496451

497452
```bash
498453
# Start controller with custom settings
499454
./manager \
500-
--metrics-addr=":8443" \
501-
--probe-addr=":8081" \
502-
--enable-leader-election \
503-
--leader-election-id="my-election-id"
455+
--metrics-bind-address=":8443" \
456+
--health-probe-bind-address=":8081" \
457+
--leader-elect \
458+
--leader-election-lease-duration=60s \
459+
--leader-election-renew-deadline=50s \
460+
--leader-election-retry-period=10s \
461+
--rest-client-timeout=60s
504462
```
505463

464+
### Configuration Parameter Reference
465+
466+
The following table lists all static configuration parameters with their CLI flag, environment variable, ConfigMap key, type, and default value. All three sources share the same key name (except CLI flags which use kebab-case).
467+
506468
**Note:** CLI flags are typically set in the Helm chart or deployment manifest, not directly.
507469

470+
| Parameter | CLI Flag | Env Var / ConfigMap Key | Type | Default | Description |
471+
|-----------|----------|------------------------|------|---------|-------------|
472+
| Metrics bind address | `--metrics-bind-address` | `METRICS_BIND_ADDRESS` | string | `0` | Metrics endpoint bind address (`:8443` for HTTPS, `:8080` for HTTP, `0` to disable) |
473+
| Health probe address | `--health-probe-bind-address` | `HEALTH_PROBE_BIND_ADDRESS` | string | `:8081` | Health probe endpoint bind address |
474+
| Leader election | `--leader-elect` | `LEADER_ELECT` | bool | `false` | Enable leader election for HA |
475+
| Leader election ID | — | `LEADER_ELECTION_ID` | string | `72dd1cf1.llm-d.ai` | Leader election coordination ID |
476+
| Lease duration | `--leader-election-lease-duration` | `LEADER_ELECTION_LEASE_DURATION` | duration | `60s` | Duration non-leaders wait before force-acquiring leadership |
477+
| Renew deadline | `--leader-election-renew-deadline` | `LEADER_ELECTION_RENEW_DEADLINE` | duration | `50s` | Duration the leader retries refreshing before giving up |
478+
| Retry period | `--leader-election-retry-period` | `LEADER_ELECTION_RETRY_PERIOD` | duration | `10s` | Duration between retry attempts |
479+
| REST timeout | `--rest-client-timeout` | `REST_CLIENT_TIMEOUT` | duration | `60s` | Timeout for Kubernetes API server REST calls |
480+
| Secure metrics | `--metrics-secure` | `METRICS_SECURE` | bool | `true` | Serve metrics endpoint via HTTPS |
481+
| Enable HTTP/2 | `--enable-http2` | `ENABLE_HTTP2` | bool | `false` | Enable HTTP/2 for metrics and webhook servers |
482+
| Watch namespace | `--watch-namespace` | `WATCH_NAMESPACE` | string | `""` | Namespace to watch (empty = all namespaces) |
483+
| Log verbosity | `-v` | `V` | int | `2` | Log level verbosity |
484+
| Webhook cert path | `--webhook-cert-path` | `WEBHOOK_CERT_PATH` | string | `""` | Directory containing the webhook certificate |
485+
| Webhook cert name | `--webhook-cert-name` | `WEBHOOK_CERT_NAME` | string | `tls.crt` | Webhook certificate file name |
486+
| Webhook cert key | `--webhook-cert-key` | `WEBHOOK_CERT_KEY` | string | `tls.key` | Webhook key file name |
487+
| Metrics cert path | `--metrics-cert-path` | `METRICS_CERT_PATH` | string | `""` | Directory containing the metrics server certificate |
488+
| Metrics cert name | `--metrics-cert-name` | `METRICS_CERT_NAME` | string | `tls.crt` | Metrics server certificate file name |
489+
| Metrics cert key | `--metrics-cert-key` | `METRICS_CERT_KEY` | string | `tls.key` | Metrics key file name |
490+
| Scale to zero | — | `WVA_SCALE_TO_ZERO` | bool | `false` | Enable scale-to-zero feature |
491+
| Limited mode | — | `WVA_LIMITED_MODE` | bool | `false` | Enable limited mode |
492+
| Scale-from-zero concurrency | — | `SCALE_FROM_ZERO_ENGINE_MAX_CONCURRENCY` | int | `10` | Max concurrent scale-from-zero operations |
493+
| EPP bearer token | — | `EPP_METRIC_READER_BEARER_TOKEN` | string | `""` | EPP metric reader bearer token |
494+
508495
### Fail-Fast Validation
509496

510497
WVA implements **fail-fast** validation: if required configuration is missing or invalid, the controller will:
@@ -611,7 +598,7 @@ spec:
611598
See [CRD Reference](crd-reference.md) for advanced configuration options.
612599

613600
## Best Practices
614-
601+
615602
### Environment Variables
616603

617604
WVA supports configuration via environment variables for operational settings:
@@ -737,4 +724,3 @@ For complete documentation, see [Multi-Controller Isolation Guide](multi-control
737724
- [Run the Quick Start Demo](../tutorials/demo.md)
738725
- [Integrate with HPA](../integrations/hpa-integration.md)
739726
- [Set up Prometheus monitoring](../integrations/prometheus.md)
740-

go.mod

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/onsi/ginkgo/v2 v2.27.2
77
github.com/onsi/gomega v1.38.2
88
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.78.2
9+
github.com/spf13/viper v1.21.0
910
github.com/stretchr/testify v1.11.1
1011
k8s.io/apimachinery v0.34.2
1112
k8s.io/client-go v0.34.2
@@ -16,7 +17,14 @@ require (
1617
require (
1718
github.com/Masterminds/semver/v3 v3.4.0 // indirect
1819
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
20+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
21+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
1922
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
23+
github.com/sagikazarmark/locafero v0.11.0 // indirect
24+
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
25+
github.com/spf13/afero v1.15.0 // indirect
26+
github.com/spf13/cast v1.10.0 // indirect
27+
github.com/subosito/gotenv v1.6.0 // indirect
2028
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
2129
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.38.0 // indirect
2230
go.yaml.in/yaml/v2 v2.4.3 // indirect
@@ -65,7 +73,7 @@ require (
6573
github.com/prometheus/common v0.67.2
6674
github.com/prometheus/procfs v0.17.0 // indirect
6775
github.com/spf13/cobra v1.9.1 // indirect
68-
github.com/spf13/pflag v1.0.7
76+
github.com/spf13/pflag v1.0.10
6977
github.com/stoewer/go-strcase v1.3.0 // indirect
7078
github.com/x448/float16 v0.8.4 // indirect
7179
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect

go.sum

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjT
2525
github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM=
2626
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
2727
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
28+
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
29+
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
2830
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
2931
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
3032
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
@@ -50,6 +52,8 @@ github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZ
5052
github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0=
5153
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
5254
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
55+
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
56+
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
5357
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
5458
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
5559
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
@@ -113,6 +117,8 @@ github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns
113117
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
114118
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
115119
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
120+
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
121+
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
116122
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
117123
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
118124
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -131,11 +137,21 @@ github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUO
131137
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
132138
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
133139
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
140+
github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc=
141+
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
142+
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
143+
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U=
144+
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
145+
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
146+
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
147+
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
134148
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
135149
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
136150
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
137-
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
138-
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
151+
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
152+
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
153+
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
154+
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
139155
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
140156
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
141157
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -149,6 +165,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
149165
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
150166
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
151167
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
168+
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
169+
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
152170
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
153171
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
154172
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=

internal/config/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,7 @@ func NewTestConfigWithPrometheus(ctx context.Context, prometheusURL string, k8sC
716716
_ = os.Setenv("PROMETHEUS_BASE_URL", prometheusURL)
717717
defer func() { _ = os.Unsetenv("PROMETHEUS_BASE_URL") }()
718718

719-
flags := StaticConfigFlags{}
720-
cfg, err := Load(ctx, flags, k8sClient)
719+
cfg, err := Load(ctx, nil, k8sClient)
721720
if err != nil {
722721
return nil, fmt.Errorf("failed to create test config: %w", err)
723722
}

0 commit comments

Comments
 (0)