cert-manager/pkg/controller
Maël Valais 20ee363366 DataForCertificate: add mock listers for certificaterequests
At first, I tried to follow the "generator" pattern that had already
been implemented for the order and secret objects. These generators look
like:

  import (
      "github.com/jetstack/cert-manager/test/unit/listers"
  )

  fake := listers.FakeSecretListerFrom(listers.NewFakeSecretLister(),
      listers.SetFakeSecretNamespaceListerGet(nil, errors.New("not found")),
  )

The major issue I was finding with this approach is that you cannot
enforce any behavior with these fakes: no way to check (or prevent)
unwanted called, no way to check that the correct namespace was used for
the call:

  fake.Secrets("default").Get("secret-1")

which is annoying; I want to be able to check every input, output and
call numbers made to the mocked function.

So I propose a gomock-like approach. I could not use mockgen due to the
fact that (again) client-go is overly nested, which means I would have
to use quite a lot of glue code in order to use mockgen-generated mocks.

Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:15:32 +01:00
..
acmechallenges Merge pull request #3500 from meyskens/update-copy 2020-12-15 10:12:31 +00:00
acmeorders Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
cainjector Minor log message clarification 2021-01-07 19:21:11 +00:00
certificaterequests Merge pull request #3699 from maelvls/ocsp-unit-test 2021-03-01 19:12:49 +00:00
certificates DataForCertificate: add mock listers for certificaterequests 2021-03-04 17:15:32 +01:00
clusterissuers Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
ingress-shim Revert ingress key usage annotation to default the same as Certificate 2021-02-04 16:08:30 +00:00
issuers Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
test Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
BUILD.bazel Remove unused helper functions 2020-11-19 12:44:18 +00:00
builder.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
context.go Removes the deprecated renew-before-expiry flag 2021-02-21 10:22:25 +00:00
controller.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
helper.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
register.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00
util.go Use The cert-manager Authors. 2020-12-11 19:04:13 +01:00