kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.64k stars 332 forks source link

MeshFaultInjection validation error message should be more specific #10907

Open slonka opened 3 months ago

slonka commented 3 months ago

Description

apiVersion: kuma.io/v1alpha1
kind: MeshFaultInjection
metadata:
  name: default
  namespace: kong-mesh-system
  labels:
    kuma.io/mesh: default # optional, defaults to `default` if it isn't configured
spec:
  targetRef:
    kind: Mesh
  to:
    - targetRef:
        kind: MeshService
        name: httpbin
      default:
        http:
          - abort:
              httpStatus: 500
              percentage: 50
kubectl apply -f mfi.yaml
The MeshFaultInjection "default" is invalid: spec.from: must not be defined

the core question here is: why?

the answer is in the code: https://github.com/kumahq/kuma/blob/cf056262652a58535baedceeb91f2409d826ecbd/pkg/plugins/policies/meshfaultinjection/api/v1alpha1/validator.go#L48 it also targets gateways but just from the error code we don't know :(

github-actions[bot] commented 20 hours ago

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.