Skip to content

Commit

Permalink
fix(MeshTLS): fix shadow policy effect for MeshTLS (#12731)
Browse files Browse the repository at this point in the history
## Motivation

We were not passing options for MeshTLS policy matching, because of this
shadow effect didn't work for it. I've also updated policy-gen tool to
prevent this from happening in the future.

<!--
> Changelog: skip
-->
<!--
Uncomment the above section to explicitly set a [`> Changelog:` entry
here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)?
-->

Signed-off-by: Marcin Skalski <[email protected]>
  • Loading branch information
Automaat authored Feb 3, 2025
1 parent 6087e0f commit fe21ef2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/plugins/policies/meshtls/plugin/v1alpha1/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewPlugin() core_plugins.Plugin {
}

func (p plugin) MatchedPolicies(dataplane *core_mesh.DataplaneResource, resources xds_context.Resources, opts ...core_plugins.MatchedPoliciesOption) (core_xds.TypedMatchingPolicies, error) {
return matchers.MatchedPolicies(api.MeshTLSType, dataplane, resources)
return matchers.MatchedPolicies(api.MeshTLSType, dataplane, resources, opts...)
}

func (p plugin) Apply(rs *core_xds.ResourceSet, ctx xds_context.Context, proxy *core_xds.Proxy) error {
Expand Down
2 changes: 1 addition & 1 deletion tools/policy-gen/bootstrap/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func NewPlugin() core_plugins.Plugin {
func (p plugin) MatchedPolicies(dataplane *core_mesh.DataplaneResource, resources xds_context.Resources, opts ...core_plugins.MatchedPoliciesOption) (core_xds.TypedMatchingPolicies, error) { {{- if not .generateTargetRef }}
panic("implement me")
{{- else }}
return matchers.MatchedPolicies(api.{{ .name }}Type, dataplane, resources)
return matchers.MatchedPolicies(api.{{ .name }}Type, dataplane, resources, opts...), nil
{{- end }}
}
Expand Down

0 comments on commit fe21ef2

Please sign in to comment.