-
Notifications
You must be signed in to change notification settings - Fork 355
Description
Kuma Version
2.13 (kuma-0.0.0-preview.v00714b786)
Describe the bug
When applying a resource, in my case MeshTrafficPermission and I don't add all information such as a namespace the generated KRI does not contain any fallbacks or defaults, which leads to a KRI that can't be used to retrieve the resource again.
Without a namespace
apiVersion: kuma.io/v1alpha1
kind: MeshTrafficPermission
metadata:
name: without-namespace
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Mesh
rules:
- default:
allow:
- spiffeID:
type: Prefix
value: spiffe://default.local.mesh.local/ns/kuma-demo
- spiffeID:
type: Prefix
value: spiffe://default.local.mesh.local/ns/another/sa/fooThe resulting KRI is: kri_mtp_default___without-namespace_
This does not work as expected as the KRI is missing any defaults/fallbacks. Fetching the KRI API with /_kri/kri_mtp_default___without-namespace_ returns 404. Instead when manually adding the defaults it returns the expected resource /_kri/kri_mtp_default_default_default_without-namespace_.
With a namespace
apiVersion: kuma.io/v1alpha1
kind: MeshTrafficPermission
metadata:
name: with-namespace
namespace: kuma-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Mesh
rules:
- default:
allow:
- spiffeID:
type: Prefix
value: spiffe://default.local.mesh.local/ns/kuma-demo
- spiffeID:
type: Prefix
value: spiffe://default.local.mesh.local/ns/another/sa/fooThe resulting KRI is: kri_mtp_default_default_kuma-demo_with-namespace_
This works as expected and I'm able to retrieve the resource via KRI API /_kri/kri_mtp_default_default_kuma-demo_with-namespace_
To Reproduce
Deploy latest kuma (I used preview kuma-0.0.0-preview.v00714b786), demo-app and apply the MTPs from above.
Expected behavior
The generated KRI should include all the necessary fallbacks/defaults such that a user is able to use that KRI to retrieve the respective resource.
Additional context (optional)
No response