Skip to content

Commit

Permalink
fix(MeshTrafficPermission): use serviceName instead of resource name …
Browse files Browse the repository at this point in the history
…for egress MTP (#7225)

Signed-off-by: Lukasz Dziedziak <lukidzi@gmail.com>
  • Loading branch information
lukidzi committed Jul 13, 2023
1 parent 41a6f79 commit 6bf2072
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
envoy_listener "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
envoy_resource "github.com/envoyproxy/go-control-plane/pkg/resource/v3"

mesh_proto "github.com/kumahq/kuma/api/mesh/v1alpha1"
"github.com/kumahq/kuma/pkg/core"
core_plugins "github.com/kumahq/kuma/pkg/core/plugins"
core_mesh "github.com/kumahq/kuma/pkg/core/resources/apis/mesh"
Expand Down Expand Up @@ -99,7 +100,10 @@ func (p plugin) configureEgress(rs *core_xds.ResourceSet, proxy *core_xds.Proxy)
}
for _, es := range resource.ExternalServices {
meshName := resource.Mesh.GetMeta().GetName()
esName := es.Meta.GetName()
esName, ok := es.Spec.GetTags()[mesh_proto.ServiceTag]
if !ok {
continue
}
policies, ok := resource.Dynamic[esName]
if !ok {
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ var _ = Describe("RBAC", func() {
{
Meta: &test_model.ResourceMeta{
Mesh: "mesh-1",
Name: "external-service-1",
Name: "es-1",
},
Spec: &mesh_proto.ExternalService{
Tags: map[string]string{
Expand Down Expand Up @@ -254,7 +254,7 @@ var _ = Describe("RBAC", func() {
{
Meta: &test_model.ResourceMeta{
Mesh: "mesh-2",
Name: "external-service-1",
Name: "es-1",
},
Spec: &mesh_proto.ExternalService{
Tags: map[string]string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func externalService(mesh string, ip string) InstallFunc {
return YamlUniversal(fmt.Sprintf(`
type: ExternalService
mesh: "%s"
name: external-service
name: es-1
tags:
kuma.io/service: external-service
kuma.io/protocol: http
Expand Down

0 comments on commit 6bf2072

Please sign in to comment.