Skip to content

Commit 2c051f6

Browse files
authored
Pass domain to launchdarkly in API (#2004)
pass domain to launchdarkly in api
1 parent ea80438 commit 2c051f6

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

iac/provider-gcp/nomad/jobs/api.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ job "api" {
103103

104104
env {
105105
ENVIRONMENT = "${environment}"
106+
DOMAIN_NAME = "${domain_name}"
106107
NODE_ID = "$${node.unique.id}"
107108
NOMAD_TOKEN = "${nomad_acl_token}"
108109
ORCHESTRATOR_PORT = "${orchestrator_port}"

iac/provider-gcp/nomad/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ resource "nomad_job" "api" {
7777
memory_mb = var.api_resources_memory_mb
7878
cpu_count = var.api_resources_cpu_count
7979

80+
domain_name = var.domain_name
8081
orchestrator_port = var.orchestrator_port
8182
otel_collector_grpc_endpoint = "localhost:${var.otel_collector_grpc_port}"
8283
logs_collector_address = "http://localhost:${var.logs_proxy_port.port}"

packages/api/internal/cfg/model.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ type Config struct {
6060
// SandboxStorageBackend selects the sandbox storage implementation.
6161
// "redis" uses Redis directly; "populate_redis" uses in-memory with Redis shadow writes.
6262
SandboxStorageBackend string `env:"SANDBOX_STORAGE_BACKEND" envDefault:"memory"`
63+
64+
DomainName string `env:"DOMAIN_NAME" envDefault:""`
6365
}
6466

6567
func Parse() (Config, error) {

packages/api/internal/handlers/store.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func NewAPIStore(ctx context.Context, tel *telemetry.Client, config cfg.Config)
130130
logger.L().Fatal(ctx, "failed to create feature flags client", zap.Error(err))
131131
}
132132

133+
featureFlags.SetDeploymentName(config.DomainName)
134+
133135
accessTokenGenerator, err := sandbox.NewAccessTokenGenerator(config.SandboxAccessTokenHashSeed)
134136
if err != nil {
135137
logger.L().Fatal(ctx, "Initializing access token generator failed", zap.Error(err))

packages/orchestrator/internal/sandbox/uffd/userfaultfd/userfaultfd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ func (u *Userfaultfd) faultPage(
374374
span.RecordError(joinedErr)
375375
u.logger.Error(ctx, "UFFD serve uffdio copy error", zap.Error(joinedErr))
376376

377-
return fmt.Errorf("failed uffdio copy %w", joinedErr)
377+
return fmt.Errorf("failed uffdio copy: %w", joinedErr)
378378
}
379379

380380
// Add the offset to the missing requests tracker with metadata.

packages/orchestrator/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ func run(config cfg.Config) (success bool) {
283283
}
284284
closers = append(closers, closer{"feature flags", featureFlags.Close})
285285

286-
if config.DomainName != "" {
287-
featureFlags.SetDeploymentName(config.DomainName)
288-
}
286+
featureFlags.SetDeploymentName(config.DomainName)
289287

290288
// gcp concurrent upload limiter
291289
limiter, err := limit.New(ctx, featureFlags)

0 commit comments

Comments
 (0)