{{- if and (.Values.allInOne.enabled) (.Values.allInOne.ingress.enabled) -}}
{{- $ingressSupportsIngressClassName := eq (include "common.ingress.supportsIngressClassname" .) "true" }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ template "jaeger.query.name" . }}
  labels:
    {{- include "jaeger.labels" . | nindent 4 }}
    app.kubernetes.io/component: all-in-one
  {{- if .Values.allInOne.ingress.annotations }}
  annotations:
    {{- toYaml .Values.allInOne.ingress.annotations | nindent 4 }}
  {{- end }}
spec:
  {{- if and $ingressSupportsIngressClassName .Values.allInOne.ingress.ingressClassName }}
  ingressClassName: {{ .Values.allInOne.ingress.ingressClassName }}
  {{- end }}
  rules:
    {{- range $host := .Values.allInOne.ingress.hosts }}
    - host: {{ $host }}
      http:
        paths:
          - path: /
            pathType: {{ default "ImplementationSpecific" $.Values.allInOne.ingress.pathType }}
            backend: {{- include "common.ingress.backend" (dict "serviceName" (include "jaeger.query.name" $) "servicePort" 16686 "context" $) | nindent 14 }}
  {{- end -}}
  {{- if .Values.allInOne.ingress.tls }}
  tls:
  {{- toYaml .Values.allInOne.ingress.tls | nindent 4 }}
  {{- end -}}
{{- end -}}
