diff --git a/internal/controller/apicerts/certs_creator.go b/internal/controller/apicerts/certs_creator.go index 73696067d..04f03f8f0 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 c4f031b6d..9a512a028 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 e69de29bb..e3063f32e 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-----