{{- if and .Values.istio.enabled .Values.istio.destinationRule.enabled }}
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: {{ include "model-registry.service.name" . }}
  {{- if .Values.global.includeNamespace }}
  namespace: {{ include "model-registry.namespace" . }}
  {{- end }}
  labels:
    {{- include "model-registry.labels" . | nindent 4 }}
spec:
  host: {{ include "model-registry.service.fullhost" . }}
  {{- with .Values.istio.destinationRule.trafficPolicy }}
  trafficPolicy:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- end }}