Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gateway2: allow child policies to always set fields unset on the parent #10548

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

shashankram
Copy link

Description

When merging parent-child policies, the merging should allow child policies to augment parent policies such that fields unset on the parent can be set by the child. There is a bug when using policy override capability with route delegation that disallows this when the annotation specifies non-wildcard fields, such that even if a field is unset by the parent only the fields specified in the override annotation are merged in - which is incorrect because the annotation only applies to fields that are being overriden (set by the parent). This change fixes the bug.

Testing done:
Adds tests that otherwise fail without the code change to the plugin.

  • Unit test
  • Translator test

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

When merging parent-child policies, the merging should allow child
policies to augment parent policies such that fields unset on the
parent can be set by the child. There is a bug when using policy
override capability with route delegation that disallows this when
the annotation specifies non-wildcard fields, such that even if
a field is unset by the parent only the fields specified in the
override annotation are merged in - which is incorrect because
the annotation only applies to fields that are being overriden
(set by the parent). This change fixes the bug.

Testing done:
Adds tests that otherwise fail without the code change to the plugin.
- Unit test
- Translator test
@solo-changelog-bot
Copy link

Issues linked to changelog:
https://github.com/solo-io/solo-projects/issues/7601

Copy link

github-actions bot commented Jan 6, 2025

Visit the preview URL for this PR (updated for commit de65623):

https://gloo-edge--pr10548-shashankram-policy-p-n9a1qbha.web.app

(expires Mon, 13 Jan 2025 22:43:37 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 77c2b86e287749579b7ff9cadb81e099042ef677

@soloio-bulldozer soloio-bulldozer bot merged commit c5bc099 into main Jan 6, 2025
21 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the shashankram/policy-prefixrewrite branch January 6, 2025 23:29
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.

4 participants