{{- if and .Values.guacamole.enabled .Values.guacamole.httproute.enabled -}}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: {{ include "bp-guacamole.webappName" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "bp-guacamole.labels" . | nindent 4 }}
spec:
  parentRefs:
    - name: {{ .Values.guacamole.httproute.parentRef.name }}
      namespace: {{ .Values.guacamole.httproute.parentRef.namespace }}
  hostnames:
    - {{ include "bp-guacamole.host" . | quote }}
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /
      backendRefs:
        - name: {{ include "bp-guacamole.webappName" . }}
          port: 80
{{- end }}
