Commit Graph
712 Commits
Author SHA1 Message Date
jetstack-botandGitHub 70c66e02a0 Merge pull request #3641 from JoshVanL/certificate-request-identity
CertificateRequest UserInfo fields
2021-03-15 14:26:15 +00:00
irbekrmandMaël Valais a89133b637 Better wording and wrap long comment lines.
Co-authored-by: Maël Valais <mael@vls.dev>
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-03-15 08:48:23 +00:00
irbekrm 8d5059b13e Updates Trigger controller integration tests
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-03-15 08:47:42 +00:00
jetstack-botandGitHub 9f343ec581 Merge pull request #3475 from maelvls/unit-test-dataforcertificate
DataForCertificate: add unit tests
2021-03-09 18:13:51 +00:00
joshvanl 1232ff799d Reorder ready condition if statement to make more clear
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-04 17:04:11 +00:00
joshvanl c07106ed6b Adds ExpectConditionReadyObservedGeneration as a framework validation
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-04 17:04:11 +00:00
joshvanl b3cab7e265 Updates the CRDs with the Certificate Condition observedGeneration field
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-04 17:04:11 +00:00
joshvanl d02f043354 Adds a check of the observedGeneration in e2e tests for ready
certificates

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-04 17:04:11 +00:00
joshvanl 39a50a1903 Updates unit certificate controller tests to include ObservedGeneration
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-04 17:04:09 +00:00
Maël Valais 680c7b75f6 DataForCertificate: use fake clientset instead of fake lister
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:20:45 +01:00
Maël ValaisandJoshVanL 10e5583991 PR comment: remove now unused listers/util.go
Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: JoshVanL <vleeuwenjoshua@gmail.com>
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:19:02 +01:00
Maël ValaisandJoshVanL 8b3bec3c9c DataForCertificate: implement Josh's fake idea
Co-Authored-By: JoshVanL <vleeuwenjoshua@gmail.com>
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:18:56 +01:00
Maël Valais 077f4ee66e Mock lister: move utils to uti.go, rm useless mocks
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:16 +01:00
Maël Valais 38919b7eb2 DataForCertificate: move certRef to test/unit/gen
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:16 +01:00
Maël Valais ca72582897 Mock lister: explain why checking mock call makes sense
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:16 +01:00
Maël Valais 7a8003f5d2 Mock lister: refactor into assertCanBeCalled
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:16 +01:00
Maël Valais 5c1fba52a5 Mock lister: fix the wrong stack frames for certificaterequests
The stack frames displayed using assert.Fail was not very informative.
That is due to t.Cleanup being called "outside" of the test case
context. There was no mention of the test file itself, gatherer_test.go
in the following example:

 certificaterequest.go:205:
         Error Trace:    certificaterequest.go:205
                                                 testing.go:872
                                                 testing.go:866
                                                 testing.go:873
                                                 testing.go:949
                                                 testing.go:1121
         Error:          lister.CertificateRequests was expected to be called but was not called
         Test:           TestDataForCertificate/should_return_error_when_the_list_func_returns_an_error

With this patch that vendors a simple version of assert.Fail, we get the
correct stack frames that the user needs in order to locate where this
failure happened:

 certificaterequest.go:254:
         Error Trace:    gatherer_test.go:230
                         gatherer_test.go:240
         Error:          lister.CertificateRequests was expected to be called but was not called
         Test:           TestDataForCertificate/should_return_error_when_the_list_func_returns_an_error

Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:16 +01:00
Maël Valais d7e3a87eae DataForCertificate: tests: fix certificaterequest lister
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:15 +01:00
Maël Valais 754035de7d DataForCertificate: tests: chained funcs pattern for CR mock
Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-04 17:16:15 +01:00
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
Richard Wall bc16ec8941 Mark Venafi E2E tests as separate Feature: group
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-02-18 18:15:36 +00:00
Richard Wall f7b80ea2b2 Skip tests containing the labels [Flaky] or [Feature:xyz]
This will allow us to skip certain known Flaky tests without having to modify
the testing infra.
And it will allow us to target these tests from a separate test job,
when we DO want to run them.

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-02-18 15:59:03 +00:00
joshvanl 16ff3ff7bb Adds e2e tests for identity. Ensures the CertificateRequest identity
properties are held

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-02-08 19:26:59 +00:00
joshvanl 4300da5fa2 Adds a sanity check to the CertificateRequest validation integration
tests to ensure that no error happens when applying a CertificateRequest
with identities set (they get modified during admission).

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-02-08 19:24:32 +00:00
irbekrm 1abc7107ca Passes a single context with cancel func to all the kubectl plugin commands
Signed-off-by: irbekrm <irbekrm@gmail.com>

Don't duplicate the existing ContextWithStopCh function

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-01-27 13:06:34 +00:00
Richard Wall 290fa4e446 E2E tests
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-22 12:12:14 +00:00
Richard Wall a5d7e24211 Install the sample-external-issuer
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-21 09:46:33 +00:00
Richard Wall 9eadb56cb9 Disable trust chain verification in ACME issuer e2e tests
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-20 14:26:43 +00:00
Richard Wall 51a334bd6e Clearer error messages
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-20 14:14:48 +00:00
Richard Wall f33066021e Always run the e2e trust chain checks
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-01-20 14:14:48 +00:00
jetstack-botandGitHub 5b2d0d660e Merge pull request #3465 from wallrj/3396-ingress-renew-before
Add duration and renew-before Ingress annotations to set those fields on the Certificate
2020-12-16 15:50:04 +00:00
Richard Wall 4ba546c97b E2E test for all Certificate field related ingress annotations
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-12-16 11:06:20 +00:00
jetstack-botandGitHub a1fe0498f2 Merge pull request #3440 from aledbf/update
Update ingress-nginx addon
2020-12-16 10:48:03 +00:00
Maartje Eyskens c0aa031339 Fix deploy of ingress-nginx
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-15 11:18:35 +01:00
jetstack-botandGitHub cdc53b65cb Merge pull request #3500 from meyskens/update-copy
Update copyright to cert-manager project
2020-12-15 10:12:31 +00:00
jetstack-botandGitHub 34396bc93b Merge pull request #3499 from meyskens/ingress-netk8sbeta1
Migrate Ingress to networking.k8s.io/v1beta1
2020-12-14 09:50:12 +00:00
Maartje Eyskens ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +01:00
jetstack-botandGitHub 2c521609de Merge pull request #3477 from tharun208/feat/profiling
Added profiling for controller
2020-12-11 14:11:10 +00:00
Tharun b4df9b3567 removed gorilla mux and used profiling util
Signed-off-by: Tharun <rajendrantharun@live.com>
2020-12-11 17:54:55 +05:30
Maartje Eyskens 2413fb0bda Fix last clientsets
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-09 15:04:21 +01:00
Maartje Eyskens 1788a9d758 Update copyright to cert-manager project
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 19:04:49 +01:00
Maartje Eyskens 65281efff1 Migrate Ingress to networking.k8s.io/v1beta1
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-08 14:46:01 +01:00
Maartje Eyskens 3a2f02f0e3 Fix old CRD reference
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-02 15:01:17 +01:00
Maartje Eyskens d705838e83 Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-20 09:46:49 +01:00
Maartje Eyskens 59048fed64 Rename field
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-20 09:46:49 +01:00
Maartje Eyskens 7b6573aa35 Add duration into ACME
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-20 09:45:32 +01:00
Maartje Eyskens 490f18b5ff Use upstream Pebble again
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-19 10:44:22 +01:00
Maartje Eyskens f7baf25239 Add a blocklist to Pebble
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-11-13 11:09:31 +01:00
Mateusz Gozdek 27fa2f1ec4 Fix various typos found by codespell
Found by running this command:

codespell -S .git,*.png,go.sum -L keypair,iam,ans,unknwon,tage,ths,creater

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-07 14:55:13 +01:00
Mateusz Gozdek 8fc98a4422 test/integration/framework: simplify to avoid word "datas"
As it is being treated as a typo by codespell.

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-07 14:53:55 +01:00