From f7390903be1e1f68b53b34f651c9dc0822e50d45 Mon Sep 17 00:00:00 2001 From: vidarno <> Date: Sat, 29 Apr 2023 09:04:29 +0200 Subject: [PATCH] Update tests after adding new LastPrivateKeyHash field in status of issuer CRDs Signed-off-by: vidarno <> --- pkg/acme/accounts/test/registry.go | 6 +++--- pkg/issuer/acme/setup_test.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/acme/accounts/test/registry.go b/pkg/acme/accounts/test/registry.go index 681e495c5..2f7fb734e 100644 --- a/pkg/acme/accounts/test/registry.go +++ b/pkg/acme/accounts/test/registry.go @@ -34,7 +34,7 @@ type FakeRegistry struct { RemoveClientFunc func(uid string) GetClientFunc func(uid string) (acmecl.Interface, error) ListClientsFunc func() map[string]acmecl.Interface - IsKeyCheckSumCachedFunc func(uid string, privateKey *rsa.PrivateKey) bool + IsKeyCheckSumCachedFunc func(lastPrivateKeyHash string, privateKey *rsa.PrivateKey) bool } func (f *FakeRegistry) AddClient(client *http.Client, uid string, config cmacme.ACMEIssuer, privateKey *rsa.PrivateKey, userAgent string) { @@ -53,6 +53,6 @@ func (f *FakeRegistry) ListClients() map[string]acmecl.Interface { return f.ListClientsFunc() } -func (f *FakeRegistry) IsKeyCheckSumCached(uid string, privateKey *rsa.PrivateKey) bool { - return f.IsKeyCheckSumCachedFunc(uid, privateKey) +func (f *FakeRegistry) IsKeyCheckSumCached(lastPrivateKeyHash string, privateKey *rsa.PrivateKey) bool { + return f.IsKeyCheckSumCachedFunc(lastPrivateKeyHash, privateKey) } diff --git a/pkg/issuer/acme/setup_test.go b/pkg/issuer/acme/setup_test.go index ba4a61d64..caf44044d 100644 --- a/pkg/issuer/acme/setup_test.go +++ b/pkg/issuer/acme/setup_test.go @@ -253,6 +253,7 @@ func TestAcme_Setup(t *testing.T) { gen.SetIssuerACMEAccountURL(acmev2Prod), gen.SetIssuerACMEEmail(someEmail), gen.SetIssuerACMELastRegisteredEmail(someEmail), + gen.SetIssuerACMELastPrivateKeyHash(someString), gen.AddIssuerCondition( *gen.IssuerConditionFrom(readyTrueCondition, gen.SetIssuerConditionStatus(cmmeta.ConditionTrue)))), @@ -538,7 +539,7 @@ func TestAcme_Setup(t *testing.T) { AddClientFunc: func(string, cmacme.ACMEIssuer, *rsa.PrivateKey, string) { addClientWasCalled = true }, - IsKeyCheckSumCachedFunc: func(uid string, privateKey *rsa.PrivateKey) bool { + IsKeyCheckSumCachedFunc: func(lastPrivateKeyHash string, privateKey *rsa.PrivateKey) bool { return true }, }