From bb4ef17e9b72490016ad85471558725a2d35fe13 Mon Sep 17 00:00:00 2001 From: Joshua Casey Date: Thu, 1 Aug 2024 12:19:34 -0500 Subject: [PATCH] Fix typos --- apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl | 3 ++- internal/controller/apicerts/certs_creator.go | 2 +- internal/controller/apicerts/certs_observer_test.go | 2 ++ internal/controller/apicerts/testdata/private_key_prefix.txt | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl index 0ee0f0dbfa..012eff04b4 100644 --- a/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl +++ b/apis/concierge/config/v1alpha1/types_credentialissuer.go.tmpl @@ -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 package v1alpha1 @@ -88,6 +88,7 @@ const ( // // If neither CertificateAuthorityData nor ca.crt is provided, no CA bundle will be advertised for // the impersonation proxy endpoint. +// TODO: Improve the docs on the fields below to reference ca.crt vs CertificateAuthorityData type ImpersonationProxyTLSSpec struct { // X.509 Certificate Authority (base64-encoded PEM bundle). // Used to advertise the CA bundle for the impersonation proxy endpoint. diff --git a/internal/controller/apicerts/certs_creator.go b/internal/controller/apicerts/certs_creator.go index ee6a78c4c0..999bb9da8b 100644 --- a/internal/controller/apicerts/certs_creator.go +++ b/internal/controller/apicerts/certs_creator.go @@ -61,7 +61,7 @@ func NewCertsCreatorController( ) controllerlib.Controller { return controllerlib.New( controllerlib.Config{ - Name: "certs-manager-controller", + Name: "certs-creator-controller", Syncer: &certsCreatorController{ namespace: namespace, certsSecretResourceName: certsSecretResourceName, diff --git a/internal/controller/apicerts/certs_observer_test.go b/internal/controller/apicerts/certs_observer_test.go index 46187c32e5..69cf851caf 100644 --- a/internal/controller/apicerts/certs_observer_test.go +++ b/internal/controller/apicerts/certs_observer_test.go @@ -242,6 +242,8 @@ func TestObserverControllerSync(t *testing.T) { actualCertChain, actualKey = dynamicCertProvider.CurrentCertKeyContent() r.True(strings.HasPrefix(string(actualCertChain), `-----BEGIN CERTIFICATE-----`), "not a cert:\n%s", string(actualCertChain)) + // Confirm that the embed worked successfully + r.True(len(privateKeyPrefix) > 0, "privateKeyPrefix should be non-empty") r.True(strings.HasPrefix(string(actualKey), privateKeyPrefix), "not a key:\n%s", string(actualKey)) }) }) diff --git a/internal/controller/apicerts/testdata/private_key_prefix.txt b/internal/controller/apicerts/testdata/private_key_prefix.txt index e69de29bb2..e3063f32e1 100644 --- a/internal/controller/apicerts/testdata/private_key_prefix.txt +++ b/internal/controller/apicerts/testdata/private_key_prefix.txt @@ -0,0 +1 @@ +-----BEGIN PRIVATE KEY-----