Skip to content

Conversation

AndreaM12345
Copy link
Contributor

@AndreaM12345 AndreaM12345 commented Apr 8, 2022

Please provide a description of this PR:
Fixes #37415

Checks an envoy filter patch operation to see if the envoy filter has a priority set or if its using a relative instead of absolute patch operation. It issues a warning if a relative patch operation (INSERT_BEFORE/INSERT_AFTER) is being used and no priority is being set.

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Configuration Infrastructure
  • Docs
  • Installation
  • Networking
  • Performance and Scalability
  • Policies and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure

@istio-policy-bot
Copy link

😊 Welcome @AndreaM12345! This is either your first contribution to the Istio istio repo, or it's been
awhile since you've been here.

You can learn more about the Istio working groups, code of conduct, and contributing guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 8, 2022
@AndreaM12345 AndreaM12345 requested review from a team as code owners April 8, 2022 19:51
@AndreaM12345 AndreaM12345 changed the title changes for issue 37415 Add istioctl analyzer for envoyFilter patch operation Apr 8, 2022
apiVersion: release-notes/v2
kind: feature
area: istioctl
releaseNotes:
Copy link
Member

Choose a reason for hiding this comment

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

Can you format the release note similar to this one? There is a way to reference the GitHub Issue directly: https://github.com/istio/istio/blob/master/releasenotes/notes/24905.yaml

Copy link
Contributor

Choose a reason for hiding this comment

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

issue:
- 37415

@istio-testing istio-testing merged commit 0c19cd8 into istio:master Apr 11, 2022
// the default priority for an envoyFilter is 0
if ef.Priority == 0 {
for index, patch := range ef.ConfigPatches {
if patch.Patch.Operation == network.EnvoyFilter_Patch_INSERT_BEFORE || patch.Patch.Operation == network.EnvoyFilter_Patch_INSERT_AFTER {
Copy link
Contributor

@frankbu frankbu Apr 11, 2022

Choose a reason for hiding this comment

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

Why are you only checking for INSERT_BEFORE and INSERT_AFTER? The problem is more general, i.e., for any operation that is relative to another filter. MERGE, REMOVE, and REPLACE are the other ones where the order of evaluation is matters.

Comment on lines +563 to +564
template: "This envoy filter does not have a priority and has a relative patch operation set which can cause the envoyFilter not to be applied. Using the INSERT_FIRST option or setting the priority may help in ensuring the envoyFilter is applied correctly"
Copy link
Contributor

Choose a reason for hiding this comment

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

Change:

Using the INSERT_FIRST option or setting the ...

to:

Using an absolute operation (e.g., INSERT_FIRST) or setting the ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test and release area/user experience size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add istioctl analyze warning about fragile EnvoyFilter patch order
6 participants