Skip to content

Commit

Permalink
(from AES) Merge pull request #1614 from datawire/concaf/fix/change-t…
Browse files Browse the repository at this point in the history
…lsContext-type

[rel/v1.6] Change Host.spec.tlsContext to LocalObjectReference
  • Loading branch information
concaf authored Jul 11, 2020
2 parents 4939ce6 + ee5a8d2 commit 4e3ccca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/getambassador.io/v2/Host.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ message HostSpec {
// Only one of `tlsConfig` or `tls` can be specified
oneof tlsConfig {
// Name of the TLSContext the Host resource is linked with
string tlsContext = 9;
k8s.io.api.core.v1.LocalObjectReference tlsContext = 9;

// TLS config
TLSConfig tls = 10;
Expand Down
3 changes: 2 additions & 1 deletion docs/topics/running/tls/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ spec:
authority: none
tlsSecret:
name: min-secret
tlsContext: min-tls-context
tlsContext:
name: min-tls-context
```

**Note**: Any `hosts` or `secret` in the `TLSContext` must be the compatible with the `Host` to which it is
Expand Down
3 changes: 2 additions & 1 deletion python/ambassador/ir/irhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def setup(self, ir: 'IR', aconf: Config) -> bool:
implicit_tls_exists = ir.has_tls_context(ctx_name)
self.logger.debug(f"TLSContext with name {ctx_name} exists in the cluster?: {implicit_tls_exists}")

host_tls_context_name = self.get('tlsContext', None)
host_tls_context_obj = self.get('tlsContext', {})
host_tls_context_name = host_tls_context_obj.get('name', None)
self.logger.debug(f"Found TLSContext: {host_tls_context_name}")

host_tls_config = self.get('tls', None)
Expand Down
3 changes: 2 additions & 1 deletion python/tests/t_hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def manifests(self) -> str:
hostname: {self.path.fqdn}
tlsSecret:
name: {self.name.k8s}-secret
tlsContext: {self.path.k8s}-separate-tls-context
tlsContext:
name: {self.path.k8s}-separate-tls-context
---
apiVersion: getambassador.io/v2
kind: TLSContext
Expand Down

0 comments on commit 4e3ccca

Please sign in to comment.