Skip to content

Commit

Permalink
Allow the Dex hostname to be set by integration tests
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Richard <richardry@vmware.com>
  • Loading branch information
joshuatcasey and cfryanr committed Aug 30, 2024
1 parent f480daf commit c0bab69
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 6 additions & 3 deletions test/deploy/tools/cert-issuer.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0

#@ load("@ytt:data", "data")
Expand Down Expand Up @@ -56,6 +56,9 @@ spec:
image: #@ data.values.cfssl_image
imagePullPolicy: IfNotPresent
command: ["/bin/bash"]
env:
- name: DEX_ISSUER_HOSTNAME
value: #@ data.values.dex_issuer_hostname
args:
- -c
- |
Expand All @@ -74,8 +77,8 @@ spec:
-ca ca.pem -ca-key ca-key.pem \
-config /tmp/cfssl-default.json \
-profile www \
-cn "dex.tools.svc.cluster.local" \
-hostname "dex.tools.svc.cluster.local" \
-cn "${DEX_ISSUER_HOSTNAME}" \
-hostname "${DEX_ISSUER_HOSTNAME}" \
/tmp/csr.json \
| cfssljson -bare dex
Expand Down
5 changes: 3 additions & 2 deletions test/deploy/tools/dex.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#! Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0

#@ load("@ytt:data", "data")
#@ load("@ytt:sha256", "sha256")
#@ load("@ytt:yaml", "yaml")

#@ def dexConfig():
issuer: https://dex.tools.svc.cluster.local/dex
#! example: https://dex.tools.svc.cluster.local/dex
issuer: #@ "https://" + data.values.dex_issuer_hostname + "/dex"
storage:
type: sqlite3
config:
Expand Down
7 changes: 6 additions & 1 deletion test/deploy/tools/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
#! Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
#! SPDX-License-Identifier: Apache-2.0

#@data/values
Expand All @@ -16,6 +16,11 @@ ports:
#! our Kind configuration which maps 127.0.0.1:12346 to port 31235 on the Kind worker node.
local: 12346


#! dex_issuer_hostname can be used to provide Dex with a DNS record or IP address for its hostname,
#! which is used to construct an issuer uri and create a certificate to serve TLS.
dex_issuer_hostname: dex.tools.svc.cluster.local

#! supervisor_redirect_uris is an array of redirect uris that dex will use for its pinniped-supervisor client.
#! usage: --data-value-yaml "supervisor_redirect_uris=[some-redirect.com,some-other-redirect.com]"
supervisor_redirect_uris: []
Expand Down

0 comments on commit c0bab69

Please sign in to comment.