mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-10 07:58:07 +00:00
refactor to use new certificateAuthorityDataSourceKind enum
Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
This commit is contained in:
committed by
Ryan Richard
parent
d4ac69d88e
commit
b70db9dc03
@@ -52,7 +52,7 @@ func TLSSpecForSupervisor(source *idpv1alpha1.TLSSpec) *TLSSpec {
|
||||
|
||||
if source.CertificateAuthorityDataSource != nil {
|
||||
dest.CertificateAuthorityDataSource = &caBundleSource{
|
||||
Kind: source.CertificateAuthorityDataSource.Kind,
|
||||
Kind: string(source.CertificateAuthorityDataSource.Kind),
|
||||
Name: source.CertificateAuthorityDataSource.Name,
|
||||
Key: source.CertificateAuthorityDataSource.Key,
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func TLSSpecForConcierge(source *authenticationv1alpha1.TLSSpec) *TLSSpec {
|
||||
}
|
||||
if source.CertificateAuthorityDataSource != nil {
|
||||
dest.CertificateAuthorityDataSource = &caBundleSource{
|
||||
Kind: source.CertificateAuthorityDataSource.Kind,
|
||||
Kind: string(source.CertificateAuthorityDataSource.Kind),
|
||||
Name: source.CertificateAuthorityDataSource.Name,
|
||||
Key: source.CertificateAuthorityDataSource.Key,
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@ func TestConciergeJWTAuthenticatorWithExternalCABundleStatusIsUpdatedWhenExterna
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
caBundleSourceSpecKind string
|
||||
caBundleSourceSpecKind authenticationv1alpha1.CertificateAuthorityDataSourceKind
|
||||
createResourceForCABundle func(t *testing.T, caBundle string) string
|
||||
updateCABundle func(t *testing.T, resourceName, caBundle string)
|
||||
}{
|
||||
{
|
||||
name: "for a CA bundle from a ConfigMap",
|
||||
caBundleSourceSpecKind: "ConfigMap",
|
||||
caBundleSourceSpecKind: authenticationv1alpha1.CertificateAuthorityDataSourceKindConfigMap,
|
||||
createResourceForCABundle: func(t *testing.T, caBundle string) string {
|
||||
createdResource := testlib.CreateTestConfigMap(t, env.ConciergeNamespace, "ca-bundle", map[string]string{
|
||||
"ca.crt": caBundle,
|
||||
@@ -58,7 +58,7 @@ func TestConciergeJWTAuthenticatorWithExternalCABundleStatusIsUpdatedWhenExterna
|
||||
},
|
||||
{
|
||||
name: "for a CA bundle from a Secret",
|
||||
caBundleSourceSpecKind: "Secret",
|
||||
caBundleSourceSpecKind: authenticationv1alpha1.CertificateAuthorityDataSourceKindSecret,
|
||||
createResourceForCABundle: func(t *testing.T, caBundle string) string {
|
||||
createdResource := testlib.CreateTestSecret(t, env.ConciergeNamespace, "ca-bundle", corev1.SecretTypeOpaque, map[string]string{
|
||||
"ca.crt": caBundle,
|
||||
|
||||
@@ -28,13 +28,13 @@ func TestConciergeWebhookAuthenticatorWithExternalCABundleStatusIsUpdatedWhenExt
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
caBundleSourceSpecKind string
|
||||
caBundleSourceSpecKind authenticationv1alpha1.CertificateAuthorityDataSourceKind
|
||||
createResourceForCABundle func(t *testing.T, caBundle string) string
|
||||
updateCABundle func(t *testing.T, resourceName, caBundle string)
|
||||
}{
|
||||
{
|
||||
name: "for a CA bundle from a ConfigMap",
|
||||
caBundleSourceSpecKind: "ConfigMap",
|
||||
caBundleSourceSpecKind: authenticationv1alpha1.CertificateAuthorityDataSourceKindConfigMap,
|
||||
createResourceForCABundle: func(t *testing.T, caBundle string) string {
|
||||
createdResource := testlib.CreateTestConfigMap(t, env.ConciergeNamespace, "ca-bundle", map[string]string{
|
||||
"ca.crt": caBundle,
|
||||
@@ -53,7 +53,7 @@ func TestConciergeWebhookAuthenticatorWithExternalCABundleStatusIsUpdatedWhenExt
|
||||
},
|
||||
{
|
||||
name: "for a CA bundle from a Secret",
|
||||
caBundleSourceSpecKind: "Secret",
|
||||
caBundleSourceSpecKind: authenticationv1alpha1.CertificateAuthorityDataSourceKindSecret,
|
||||
createResourceForCABundle: func(t *testing.T, caBundle string) string {
|
||||
createdResource := testlib.CreateTestSecret(t, env.ConciergeNamespace, "ca-bundle", corev1.SecretTypeOpaque, map[string]string{
|
||||
"ca.crt": caBundle,
|
||||
|
||||
Reference in New Issue
Block a user