Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #184 from diegofernandes/master
Browse files Browse the repository at this point in the history
fix support wildcard tls host on ingress
  • Loading branch information
Crazybus authored Jun 24, 2019
2 parents e27d753 + 89652ea commit 80845fc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
8 changes: 1 addition & 7 deletions kibana/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ metadata:
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
Expand Down
28 changes: 28 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,34 @@ def test_adding_an_ingress_rule():
assert i['rules'][0]['http']['paths'][0]['backend']['serviceName'] == name
assert i['rules'][0]['http']['paths'][0]['backend']['servicePort'] == 5601

def test_adding_an_ingress_rule_wildcard():
config = '''
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
path: /
hosts:
- kibana.elastic.co
tls:
- secretName: elastic-co-wildcard
hosts:
- "*.elastic.co"
'''

r = helm_template(config)
assert name in r['ingress']
i = r['ingress'][name]['spec']
assert i['tls'][0]['hosts'][0] == '*.elastic.co'
assert i['tls'][0]['secretName'] == 'elastic-co-wildcard'

assert i['rules'][0]['host'] == 'kibana.elastic.co'
assert i['rules'][0]['http']['paths'][0]['path'] == '/'
assert i['rules'][0]['http']['paths'][0]['backend']['serviceName'] == name
assert i['rules'][0]['http']['paths'][0]['backend']['servicePort'] == 5601



def test_override_the_default_update_strategy():
config = '''
updateStrategy:
Expand Down

0 comments on commit 80845fc

Please sign in to comment.