chore: auto-add istio ingress gateway namespace to AuthorizationPolicy #344
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref: #342
Motivation
We have an
AuthorizationPolicy
where users can set allowedNamespaces. However, it's easy to miss the namespace of the ingress gateway that users may want their VirtualService tied to.What This Does
This parses the namespace of the istio gateways that users provide and
creates a new list by appending it to the allowedNamespaces-provided listadds a separate rule for itThis is a safe assumption due to our checks of its format:
k8s-charts/charts/simple-app/templates/istio/virtualservice.yaml
Line 19 in ca85ca6
Test
Updated set
network.allowAll
andvirtualService.enabled
in values.local.yaml to `true...Resulting relevant diff of
make template
:First Commit
Updated Commit