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

Cache: fix an issue where the cache key for mappings is wrong when mu… #4250

Merged
merged 3 commits into from
May 27, 2022

Conversation

Alice-Lilith
Copy link
Member

@Alice-Lilith Alice-Lilith commented May 27, 2022

…ltiple mappings have the same name

Signed-off-by: AliceProxy [email protected]

Description

In Emissary-ingress 2.2 (and likely other 2.x releases) if you have multiple Mappings with the same metadata.name but in different metadata.namespaces, then any updates to these Mappings will only happen in the first (when sorted alphanumerically) Mapping. The envoy config for the the remaining Mappings will only ever be updated when the pods restart. A workaround is available by not using the same metadata.name for multiple Mappings.

Related Issues

N/A

Testing

I did some manual testing to inspect the logs/envoy config generated that I used to construct the unit test additions to the cache tests.

Checklist

  • I made sure to update CHANGELOG.md.

    Remember, the CHANGELOG needs to mention:

    • Any new features
    • Any changes to our included version of Envoy
    • Any non-backward-compatible changes
    • Any deprecations
  • This is unlikely to impact how Ambassador performs at scale.

    Remember, things that might have an impact at scale include:

    • Any significant changes in memory use that might require adjusting the memory limits
    • Any significant changes in CPU use that might require adjusting the CPU limits
    • Anything that might change how many replicas users should use
    • Changes that impact data-plane latency/scalability
  • My change is adequately tested.

    Remember when considering testing:

    • Your change needs to be specifically covered by tests.
      • Tests need to cover all the states where your change is relevant: for example, if you add a behavior that can be enabled or disabled, you'll need tests that cover the enabled case and tests that cover the disabled case. It's not sufficient just to test with the behavior enabled.
    • You also need to make sure that the entire area being changed has adequate test coverage.
      • If existing tests don't actually cover the entire area being changed, add tests.
      • This applies even for aspects of the area that you're not changing – check the test coverage, and improve it if needed!
    • We should lean on the bulk of code being covered by unit tests, but...
    • ... an end-to-end test should cover the integration points
  • I updated DEVELOPING.md with any any special dev tricks I had to use to work on this code efficiently.

  • The changes in this PR have been reviewed for security concerns and adherence to security best practices.

…ltiple mappings have the same name

Signed-off-by: AliceProxy <[email protected]>
@Alice-Lilith Alice-Lilith force-pushed the alicewasko/mapping-cache-keyname branch from def9e72 to 319b0d3 Compare May 27, 2022 18:42
@Alice-Lilith Alice-Lilith changed the title cache: fix an issue where the cache key for mappings is wrong when mu… Cache: fix an issue where the cache key for mappings is wrong when mu… May 27, 2022
@Alice-Lilith Alice-Lilith marked this pull request as ready for review May 27, 2022 18:42
Copy link
Contributor

@LanceEa LanceEa left a comment

Choose a reason for hiding this comment

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

Everything looks good...two quick questions on the test to make sure I understand it.

@Alice-Lilith Alice-Lilith requested a review from LanceEa May 27, 2022 19:35
Copy link
Contributor

@LanceEa LanceEa left a comment

Choose a reason for hiding this comment

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

lgtm and CI is green so go for it. Great work identifying and getting this fixed!

@Alice-Lilith Alice-Lilith merged commit 2c881ba into release/v2.3 May 27, 2022
@Alice-Lilith Alice-Lilith deleted the alicewasko/mapping-cache-keyname branch May 27, 2022 19:43
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.

2 participants