Skip to content

Commit

Permalink
Fixed tls issue in k8s ingress
Browse files Browse the repository at this point in the history
tls is not taken when ingress rules has paths only
which caused the issue which is taken care.

Change-Id: I84642f032e0897f70cadccf910626cf8eb5c04fe
Closes-bug: #1710778
  • Loading branch information
ymariappan committed Aug 15, 2017
1 parent 506ab7a commit 1562347
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/container/kube-manager/kube_manager/vnc/vnc_ingress.py
Expand Up @@ -450,13 +450,17 @@ def _get_new_backend_list(self, spec, ns_name):
backend['listener']['protocol'] = 'HTTP'
backend['pool']['protocol'] = 'HTTP'
secretname = ""
virtual_host = False
if 'host' in rule:
host = rule['host']
backend['annotations']['host'] = host
if host in tls_dict.keys():
secretname = tls_dict[host]
virtual_host = True
if 'path' in path:
backend['annotations']['path'] = path['path']
if virtual_host == False and 'ALL' in tls_dict.keys():
secretname = 'ALL'
service = path['backend']
backend['annotations']['type'] = 'acl'
backend['member']['serviceName'] = service['serviceName']
Expand All @@ -465,7 +469,10 @@ def _get_new_backend_list(self, spec, ns_name):
if secretname:
backend_https = copy.deepcopy(backend)
backend_https['listener']['protocol'] = 'TERMINATED_HTTPS'
backend_https['listener']['sni_containers'] = [secretname]
if virtual_host:
backend_https['listener']['sni_containers'] = [secretname]
else:
backend_https['listener']['default_tls_container'] = tls_dict['ALL']
backend_list.append(backend_https)
if 'backend' in spec:
service = spec['backend']
Expand Down

0 comments on commit 1562347

Please sign in to comment.