Skip to content

Commit

Permalink
fix(MeshService): add kuma.io/display-name label to generated MeshSer…
Browse files Browse the repository at this point in the history
…vice on universal (#11348)

* test(e2e): in MeshMultiZoneService multizone, use generated Kubernetes MeshService
* test(e2e): in MeshMultiZoneService multizone, use generated universal MeshService
* fix(MeshService): add kuma.io/display-name label to generated MeshServices on universal

Signed-off-by: Mike Beaumont <[email protected]>
  • Loading branch information
michaelbeaumont authored Sep 10, 2024
1 parent 25ca9d3 commit ee63fb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 44 deletions.
1 change: 1 addition & 0 deletions pkg/core/resources/apis/meshservice/generate/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ func (g *Generator) generate(ctx context.Context, mesh string, dataplanes []*cor
}
if err := g.resManager.Create(ctx, meshService, store.CreateByKey(name, mesh), store.CreateWithLabels(map[string]string{
metadata.KumaMeshLabel: mesh,
mesh_proto.DisplayName: name,
mesh_proto.ManagedByLabel: managedByValue,
mesh_proto.EnvTag: mesh_proto.UniversalEnvironment,
mesh_proto.ResourceOriginLabel: string(mesh_proto.ZoneResourceOrigin),
Expand Down
44 changes: 0 additions & 44 deletions test/e2e_env/multizone/meshmultizoneservice/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ spec:
meshService:
matchLabels:
kuma.io/display-name: test-server
k8s.kuma.io/namespace: mzmsconnectivity
ports:
- port: 80
appProtocol: http
Expand All @@ -49,62 +48,19 @@ spec:
Setup(multizone.KubeZone1)
Expect(err).ToNot(HaveOccurred())

kubeServiceYAML := `
apiVersion: kuma.io/v1alpha1
kind: MeshService
metadata:
name: test-server
namespace: mzmsconnectivity
labels:
kuma.io/origin: zone
kuma.io/mesh: mzmsconnectivity
kuma.io/managed-by: k8s-controller
k8s.kuma.io/is-headless-service: "false"
spec:
selector:
dataplaneTags:
app: test-server
k8s.kuma.io/namespace: mzmsconnectivity
ports:
- port: 80
name: main
targetPort: main
appProtocol: http
`
err = NewClusterSetup().
Install(NamespaceWithSidecarInjection(namespace)).
Install(testserver.Install(
testserver.WithNamespace(namespace),
testserver.WithMesh(meshName),
testserver.WithEchoArgs("echo", "--instance", "kube-test-server-2"),
)).
Install(YamlK8s(kubeServiceYAML)).
Setup(multizone.KubeZone2)
Expect(err).ToNot(HaveOccurred())

uniServiceYAML := `
type: MeshService
name: test-server
mesh: mzmsconnectivity
labels:
kuma.io/origin: zone
kuma.io/env: universal
k8s.kuma.io/namespace: mzmsconnectivity # add a label to aggregate kube and uni service
kuma.io/display-name: test-server # add a label to aggregate kube and uni service
spec:
selector:
dataplaneTags:
kuma.io/service: test-server
ports:
- port: 80
targetPort: 80
appProtocol: http
`

err = NewClusterSetup().
Install(DemoClientUniversal("demo-client", meshName, WithTransparentProxy(true))).
Install(TestServerUniversal("test-server", meshName, WithArgs([]string{"echo", "--instance", "uni-test-server"}))).
Install(YamlUniversal(uniServiceYAML)).
Setup(multizone.UniZone1)
Expect(err).ToNot(HaveOccurred())
})
Expand Down

0 comments on commit ee63fb3

Please sign in to comment.