Skip to content

Verify whether validators that allow an empty list of to are correct #13294

@lukidzi

Description

@lukidzi

Description

We can observe that different policies have different rules. We should ensure these validators are correct and do not prevent users from overriding policies.

Policies where we verify to > 0:

Policies where we verify to != nil or empty list:

Concern:

I have a MeshHealthCheck policy

apiVersion: kuma.io/v1alpha1
kind: MeshHealthCheck
metadata:
  name: web-to-backend-check
  namespace: kuma-demo
  labels:
    kuma.io/mesh: default
spec:
  targetRef:
    kind: Mesh
  to:
  - targetRef:
      kind: MeshService
      name: backend
      namespace: kuma-demo
      sectionName: http
    default:
      interval: 10s
      timeout: 2s
      unhealthyThreshold: 3
      healthyThreshold: 1
      http:
        path: "/health"
        expectedStatuses:
        - 200
        - 201

But I want a service web to not have this healthCheck

apiVersion: kuma.io/v1alpha1
kind: MeshHealthCheck
metadata:
  name: web-to-backend-check
  namespace: kuma-demo
  labels:
    kuma.io/mesh: default
spec:
  targetRef:
    kind: Dataplane
    labels:
      app: web
  to: []

How can I achieve this? Is it even possible since based on docs https://kuma.io/docs/2.10.x/policies/introduction/#merging-configuration I think we don't support this?

Expected behavior

  1. Which policies should be overrideable?
  2. How can users override them?
  3. How can we ensure a clear and consistent API for to? The thing that works on MeshTimeout won't work for MeshLoadBalancingStrategy

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions