I have a VirtualService configuration but get the error message:
admission webhook "validation.istio.io" denied the request: configuration is invalid: delegate virtual service must have no gateways specified

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: virtualservice-ingress
  namespace: {{ .Release.Namespace }}
spec:
  {{- with .Values.dns }}
  hosts:
    {{- toYaml . | nindent 2 }}
  {{- end }}
  gateways:
  - default-gateway-ingress
  http:
  - match:
    - uri:
        prefix: /test
    route:
    - destination:
        port:
          number: 80
        host: test1
  - match:
    - uri:
        prefix: /test2
    route:
    - destination:
        port:
          number: 80
        host: test2
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        port:
          number: 80
        host: test
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: default-gateway-ingress
  namespace: {{ .Release.Namespace }}
spec:
  selector:
    istio: ingress
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    tls:
      httpsRedirect: true # sends 301 redirect for http requests
    {{- with .Values.dns }}
    hosts:
      {{- toYaml . | nindent 4 }}
    {{- end }}
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: "{{ .Release.Namespace }}-tls"
    {{- with .Values.dns }}
    hosts:
      {{- toYaml . | nindent 4 }}
    {{- end }}

I looked at the documentation at istio virtaul service but can’t figure out what the problem would be.
The Gateway and VirtualService are applied in 2 seperate files but are contained in the same helm chart.

The helm install / apply should be possible and routing will be handeld as configured in the VirtualSerivce