Skip to content

Commit

Permalink
fix: canary duty context in topology lookup for correct object metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Jan 1, 2024
1 parent 3022111 commit 0f5d1ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/topology/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ func lookupComponents(ctx *ComponentContext, component v1.ComponentSpec) (compon
func lookup(ctx *ComponentContext, name string, spec v1.CanarySpec) ([]interface{}, error) {
var results []any

canaryCtx := context.New(ctx.Duty, v1.NewCanaryFromSpec(name, ctx.Namespace, spec))
canarySpec := v1.NewCanaryFromSpec(name, ctx.Namespace, spec)
dutyCtx := ctx.Duty.
WithNamespace(ctx.Namespace).
WithObject(canarySpec.ObjectMeta)

canaryCtx := context.New(dutyCtx, canarySpec)
canaryCtx.Context = ctx
canaryCtx.Namespace = ctx.Namespace
canaryCtx.Environment = ctx.Environment
Expand Down

0 comments on commit 0f5d1ea

Please sign in to comment.