refactor to use new certificateAuthorityDataSourceKind enum

Signed-off-by: Ashish Amarnath <ashish.amarnath@broadcom.com>
This commit is contained in:
Ashish Amarnath
2024-08-03 16:59:18 -07:00
committed by Ryan Richard
parent d4ac69d88e
commit b70db9dc03
3 changed files with 8 additions and 8 deletions

View File

@@ -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,
}

View File

@@ -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,

View File

@@ -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,