add SAN to default cert in supervisor_discovery_test.go

This commit is contained in:
Ryan Richard
2024-11-04 17:34:53 -08:00
parent febbee347b
commit fedb9812bd
4 changed files with 93 additions and 49 deletions
+11 -5
View File
@@ -53,12 +53,18 @@ func TestSupervisorOIDCDiscovery_Disruptive(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
temporarilyRemoveAllFederationDomainsAndDefaultTLSCertSecret(ctx, t, env.SupervisorNamespace, env.DefaultTLSCertSecretName(), client, testlib.NewKubernetesClientset(t))
defaultCA := createTLSServingCertSecretForSupervisor(
ctx,
temporarilyRemoveAllFederationDomainsAndDefaultTLSCertSecret(ctx,
t, env.SupervisorNamespace, env.DefaultTLSCertSecretName(), client, kubeClient)
supervisorIssuer := testlib.NewSupervisorIssuer(t, env.SupervisorHTTPSAddress)
if env.SupervisorHTTPSIngressAddress != "" {
// Since this cert could be used for either server name in the tests below, make it valid for both names.
supervisorIssuer.AddAlternativeName(env.SupervisorHTTPSIngressAddress)
}
defaultCA := createTLSServingCertSecretForSupervisor(ctx,
t,
env,
testlib.NewSupervisorIssuer(t, env.SupervisorHTTPSAddress),
supervisorIssuer,
env.DefaultTLSCertSecretName(),
kubeClient,
)
@@ -367,7 +373,7 @@ func createTLSServingCertSecretForSupervisor(
ctx context.Context,
t *testing.T,
env *testlib.TestEnv,
supervisorIssuer testlib.SupervisorIssuer,
supervisorIssuer *testlib.SupervisorIssuer,
secretName string,
kubeClient kubernetes.Interface,
) *certauthority.CA {