Skip to content

Conversation

@ajanikow
Copy link
Collaborator

No description provided.

@cla-bot cla-bot bot added the cla-signed label Nov 19, 2025
@ajanikow ajanikow requested a review from Copilot November 19, 2025 09:48
Copilot finished reviewing on behalf of ajanikow November 19, 2025 09:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where response headers in Envoy configurations were rendered in non-deterministic order due to Go's map iteration randomness. The fix ensures headers are sorted alphabetically by key, making the configuration output deterministic and checksum-stable.

Key Changes

  • Modified header iteration in RenderRoute to use sorted keys instead of random map iteration
  • Updated test helper to return checksum for validation
  • Added determinism test that verifies the same configuration produces identical checksums across 128 iterations

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/deployment/resources/gateway/gateway_config_destination.go Changed ResponseHeaders iteration to use sorted keys via util.SortKeys(), ensuring deterministic header ordering in Envoy config
pkg/deployment/resources/gateway/gateway_config_test.go Modified test helper to return checksum and added test loop to verify deterministic output with multiple targets and response headers
CHANGELOG.md Added changelog entry for the bugfix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ajanikow ajanikow merged commit ac4e66f into master Nov 19, 2025
8 of 9 checks passed
@ajanikow ajanikow deleted the feature/platform/sort_envoy_headers branch November 19, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants