Skip to content

fix: reconcile service trafficDistribution updates - #1943

Open
immanuwell wants to merge 1 commit into
fluxcd:mainfrom
immanuwell:fix/reconcile-traffic-distribution
Open

fix: reconcile service trafficDistribution updates#1943
immanuwell wants to merge 1 commit into
fluxcd:mainfrom
immanuwell:fix/reconcile-traffic-distribution

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

Follow-up to #1844.

If spec.service.trafficDistribution is added or changed after Flagger already created the Services, reconcile leaves podinfo, podinfo-primary, and podinfo-canary stale. The field just stays unset, kinda annoying.

This patch updates Service.spec.trafficDistribution during reconcile, so existing Services match the Canary spec too.

Repro:

  1. Create a Canary without spec.service.trafficDistribution.
  2. Let Flagger create the Services.
  3. Update the Canary and set spec.service.trafficDistribution: PreferClose.
  4. Before this patch, all 3 Services still keep spec.trafficDistribution empty.

Checks:

  • go test ./pkg/router -run TestServiceRouter_UpdateTrafficDistribution -count=1
  • go test ./...

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell

Copy link
Copy Markdown
Contributor Author

@stefanprodan @aryan9600 please take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant