Skip to content

Commit 5b1e6af

Browse files
committed
feat(orchestrator): carry envd-version on build-path sandbox LD context
Drive the envd-version attribute off Config.Envd.Version in the shared sandboxLDContext helper so it is present on both regular and build sandboxes (envd version is resolved during build). Switch the freeze-user-cgroup and reclaim-config evals to this helper so they no longer depend on server-side ctx propagation, which the build path does not run.
1 parent ae0361e commit 5b1e6af

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎packages/orchestrator/pkg/sandbox/reclaim.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ func (s *Sandbox) bestEffortReclaim(ctx context.Context) {
6262
ctx, span := tracer.Start(ctx, "envd-reclaim")
6363
defer span.End()
6464

65+
sbxCtx := sandboxLDContext(s.Runtime, s.Config)
66+
6567
cfg := featureflags.GetReclaimConfig(ctx, s.featureFlags,
66-
featureflags.SandboxContext(s.Runtime.SandboxID),
68+
sbxCtx,
6769
featureflags.TeamContext(s.Runtime.TeamID),
6870
featureflags.TemplateContext(s.Runtime.TemplateID),
6971
)
7072

7173
if s.featureFlags.BoolFlag(ctx, featureflags.FreezeUserCgroupFlag,
72-
featureflags.SandboxContext(s.Runtime.SandboxID),
74+
sbxCtx,
7375
featureflags.TeamContext(s.Runtime.TeamID),
7476
featureflags.TemplateContext(s.Runtime.TemplateID),
7577
) {

‎packages/orchestrator/pkg/sandbox/sandbox.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ type RuntimeMetadata struct {
183183
SandboxType SandboxType
184184
}
185185

186-
// sandboxLDContext builds an LD context with kernel/FC-version attributes for
186+
// sandboxLDContext builds an LD context with envd/kernel/FC-version attributes for
187187
// per-sandbox flag targeting. Team/template targeting comes from the team and
188188
// template contexts the caller embeds in ctx.
189189
func sandboxLDContext(runtime RuntimeMetadata, config *Config) ldcontext.Context {
@@ -192,6 +192,7 @@ func sandboxLDContext(runtime RuntimeMetadata, config *Config) ldcontext.Context
192192
SetString(featureflags.SandboxTemplateAttribute, runtime.TemplateID).
193193
SetString(featureflags.SandboxKernelVersionAttribute, config.FirecrackerConfig.KernelVersion).
194194
SetString(featureflags.SandboxFirecrackerVersionAttribute, config.FirecrackerConfig.FirecrackerVersion).
195+
SetString(featureflags.SandboxEnvdVersionAttribute, config.Envd.Version).
195196
SetString(featureflags.SandboxTypeAttribute, runtime.SandboxType.String()).
196197
Build()
197198
}

0 commit comments

Comments
 (0)