Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuatcasey committed Aug 9, 2023
1 parent 1707995 commit 7f0d04d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/integration/concierge_impersonation_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
)
})

t.Run("using externally provided TLS serving cert", func(t *testing.T) {
t.Run("using externally provided TLS serving cert with stringData", func(t *testing.T) {
var externallyProvidedCA *certauthority.CA
externallyProvidedCA, err = certauthority.New("Impersonation Proxy Integration Test CA", 1*time.Hour)
require.NoError(t, err)
Expand All @@ -1787,13 +1787,15 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
externallyProvidedTLSServingCertPEM, externallyProvidedTLSServingKeyPEM, err = externallyProvidedCA.IssueServerCertPEM([]string{proxyServiceEndpoint}, nil, 1*time.Hour)
require.NoError(t, err)

// Specifically use corev1.Secret.StringData
// https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-config-file/#create-the-config-file
externallyProvidedTLSServingCertSecret := testlib.CreateTestSecret(
t,
env.ConciergeNamespace,
"external-tls-cert-secret-name",
corev1.SecretTypeTLS,
map[string]string{
"ca.crt": string(externallyProvidedTLSServingCertPEM),
"ca.crt": string(externallyProvidedCA.Bundle()),
v1.TLSCertKey: string(externallyProvidedTLSServingCertPEM),
v1.TLSPrivateKeyKey: string(externallyProvidedTLSServingKeyPEM),
})
Expand Down Expand Up @@ -1848,7 +1850,7 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
}, 2*time.Minute, 500*time.Millisecond)
})

t.Run("using externally provided TLS serving cert with byte arrays", func(t *testing.T) {
t.Run("using externally provided TLS serving cert with data []byte arrays", func(t *testing.T) {
var externallyProvidedCA *certauthority.CA
externallyProvidedCA, err = certauthority.New("Impersonation Proxy Integration Test CA", 1*time.Hour)
require.NoError(t, err)
Expand All @@ -1857,6 +1859,8 @@ func TestImpersonationProxy(t *testing.T) { //nolint:gocyclo // yeah, it's compl
externallyProvidedTLSServingCertPEM, externallyProvidedTLSServingKeyPEM, err = externallyProvidedCA.IssueServerCertPEM([]string{proxyServiceEndpoint}, nil, 1*time.Hour)
require.NoError(t, err)

// Specifically use corev1.Secret.Data
// https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-config-file/#create-the-config-file
externallyProvidedTLSServingCertSecret := testlib.CreateTestSecretBytes(
t,
env.ConciergeNamespace,
Expand Down

0 comments on commit 7f0d04d

Please sign in to comment.