[stable/minio] allow ingress to have empty host (#21315)

Allow enabling ingress with a host not set. Currently, it's not possible
if we want to enable ingress, but does not want to set a host for the
ingress rule.

With this patch, if you set the host to be an empty string, the host
field in the Ingress rule won't be set, allowing all inbound traffic
regardless of the host used.

Tested with this values:

```yaml
ingress:
  enabled: true
  hosts:
  - ""
```

```bash
$ helm template . myvalues.yaml
...
kind: Ingress
metadata:
  name: release-name-minio
  labels:
    app: minio
    chart: minio-5.0.12
    release: release-name
    heritage: Tiller
spec:
  rules:
    - http:
        paths:
          - path: /
            backend:
              serviceName: release-name-minio
              servicePort: 9000
```

Signed-off-by: Jie Yu <yujie.jay@gmail.com>
This commit is contained in:
Jie Yu
2020-03-07 01:51:34 -08:00
committed by GitHub
parent 9cce76b151
commit 09745daea8
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
description: MinIO is a high performance data infrastructure for machine learning, analytics and application data workloads.
name: minio
version: 5.0.12
version: 5.0.13
appVersion: master
keywords:
- storage
+4 -2
View File
@@ -32,12 +32,14 @@ spec:
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
- http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $servicePort }}
{{- if . }}
host: {{ . | quote }}
{{- end }}
{{- end }}
{{- end }}