Commit Graph

42 Commits

Author SHA1 Message Date
Richard Wall
5d91f0a3c4 Fix flaky test by using EqualUnsorted to compare Events
Supplants https://github.com/jetstack/cert-manager/pull/4297

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-10-01 12:41:15 +01:00
Jake Sanders
87bf05601f
Update pkg/controller/test/context_builder.go
Signed-off-by: Jake Sanders <i@am.so-aweso.me>

Co-authored-by: Maël Valais <mael@vls.dev>
2021-07-26 18:29:56 +01:00
Jake Sanders
67c6586161
Addressing code review comments in #4225
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-07-26 18:29:54 +01:00
Jake Sanders
0d93b93fc5
Feature: Support both v1 and v1beta1 ingresses.
Kubernetes is removing support for the v1beta1 Ingress type in 1.22: https://kubernetes.io/blog/2021/07/14/upcoming-changes-in-kubernetes-1-22/#api-changes
However, we still wish to support k8s v1.16 until mid 2022 when Openshift 3 becomes out of support.

cert-manager will now use v1 Ingress if available by using the discovery API.

Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-07-26 18:29:42 +01:00
Maël Valais
30f9c123d3 gateway-shim: add the gateway-shim controller
Note that the gateway-shim is only half the work for supporting the
Gateway API in cert-manager. The other half is the HTTP01 solver
support, which is still worked on.

The Gateway API in cert-manager is releases as an experimental feature
and needs to be enabled manually with the following flag:

  --controllers=*,gateway-shim

All the annotations supported by ingress-shim are also supported by
gateway-shim, with some exceptions:

  "acme.cert-manager.io/http01-ingress-class"

This annotation is not supported on the Gateway resource. Although the
Gateway resource also has a "gatewayClass" field, we will need to add
another field instead of "ingress-class" to avoid confusion with the
ingress-shim.

  "acme.cert-manager.io/http01-edit-in-place"

This annotation is not supported because it is specific to some ingress
controllers like ingress-gce.

  "kubernetes.io/tls-acme"

This annotation is not supported because it is a behavior inherited from
kube-lego and we chose not to keep this behavior with the Gateway API.

Unlike the ingress-shim, you can reuse the same Secret name in multiple
TLS configurations on the same Gateway resource.

The ingress-shim now shows the exact location of the duplicate
secretName when the user gives the same secretName in two separate TLS
blocks.

Signed-off-by: Maël Valais <mael@vls.dev>
Co-authored-by: Jake Sanders <i@am.so-aweso.me>
2021-07-15 20:34:55 +02:00
kit837
0f97e6d19d pass in clock.Clock for better test
Signed-off-by: kit837 <66801824+kit837@users.noreply.github.com>
2021-06-15 17:48:20 +00:00
Ashley Davis
c67c2c4f47
static analysis: pkg/controller
fixes the following issues:

pkg/controller/acmeorders/util.go:84:6 deadcode `hashChallenge` is unused
pkg/controller/certificaterequests/approver/approver.go:72:14 staticcheck SA4021: x = append(y) is equivalent to x = y
pkg/controller/certificaterequests/vault/vault_test.go:535:21 errcheck Error return value of `controller.Register` is not checked
pkg/controller/certificates/trigger/policies/policies.go:121:26 gosimple S1039: unnecessary use of fmt.Sprintf
pkg/controller/clusterissuers/sync_test.go:55:12 errcheck Error return value of `c.Register` is not checked
pkg/controller/ingress-shim/sync.go:301:2 gosimple S1005: unnecessary assignment to the blank identifier

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-05-21 12:03:47 +01:00
Jake Sanders
79d8d9cb7b
Revert "Merge pull request #3724 from inteon/istio-virtualservice-for-http01"
This reverts commit 80f27739b5, reversing
changes made to 96604d02a3.

Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-11 14:50:25 +01:00
Inteon
2d7dfcb462 start DynamicSharedInformerFactory unconditionally; only listen for VirtualServices conditionally
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-04-28 09:20:49 +02:00
Inteon
624e2b9e69 add ACME HTTP01 Istio support
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-04-28 09:19:53 +02: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
Maartje Eyskens
ab0cd57dc5 Use The cert-manager Authors.
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-12-11 19:04:13 +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
James Munnelly
1adfe16690 Bulk fix of non-test staticcheck failures
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-06-26 12:25:08 +01:00
JoshVanL
e465329b80
Revert vault free port and expose listener port from metrics server
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-05-26 23:01:55 +01:00
JoshVanL
3e7f7eb87e
Expose Prometheus listen address as a controller command line flag
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-05-18 18:21:03 +01:00
JoshVanL
92eb8d0957
Refactor controllers to use new instrumented metrics that's baked into
all controllers

Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-05-18 17:43:56 +01:00
James Munnelly
822b9e17a0 Remove AdditionalRunFuncs from base controller
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-03-30 20:43:00 +01:00
James Munnelly
fdce8c6406 Fix Sync() method to allow time for testing informers to sync
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-11-14 19:43:02 +00:00
James Munnelly
ea5c111bca Add RegisterAdditionalSyncFuncs
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-08-22 13:11:33 +01:00
James Munnelly
1b8a286206 Rename Setup->Init and use Start to start informers
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-08-22 13:11:33 +01:00
James Munnelly
73364f592b Fix panic
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-26 15:45:34 +01:00
James Munnelly
8a2bcb5dd1 Set the apiutil clock in test builder
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-26 15:09:24 +01:00
James Munnelly
99bbc31386 Promote 'Clock' to be a field on controller context
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-26 12:30:23 +01:00
James Munnelly
434b2408be Add CheckAndFinish to controller test.Builder
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-25 15:58:39 +01:00
JoshVanL
a0d5793d9b Adds Recorder event tests to CA CR controller
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-07-23 18:18:44 +01:00
JoshVanL
f8c511a705 Address ca sign returning error
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-07-23 12:06:30 +01:00
JoshVanL
ab838197fc Move CA signer into ./pkg/controller/certificaterequests/ca
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-07-23 09:27:22 +01:00
James Munnelly
442789113a Refactor controllers to not reference BaseController
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-06-19 15:11:06 +01:00
James Munnelly
1d319f3cd4 Copy labels from Ingress to Certificate resource in ingress-shim
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-05-19 11:00:10 +02:00
James Munnelly
aeaa3412ed Fix controller test pkg
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-12 14:24:51 +00:00
James Munnelly
5d73076db9 Update logs package for go-logr
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-12 14:24:50 +00:00
jetstack-bot
01903f06ba
Merge pull request #1384 from munnerz/unit-compare-reading
Print unit test failures in action matchers as part of failure message
2019-02-22 18:16:38 +00:00
James Munnelly
2f30258f0e Switch to klog
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-22 12:34:02 +00:00
James Munnelly
381bed1fd8 Print unit test failures in action matchers as part of failure message
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-20 17:27:31 +00:00
James Munnelly
d055d370bb Plumb testing.T through to test Builder
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-31 20:20:20 +00:00
James Munnelly
0fcc0c666c Update copyright header year
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 15:07:55 +00:00
James Munnelly
939c90c356 Log events in the FakeRecorder in e2e tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-29 12:11:42 +00:00
James Munnelly
847d0c6152 Refactor controllers to return Response structures
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:38 +01:00
James Munnelly
5482ece3f5 Update unit test framework to support actions and required reactors
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-12 12:40:38 +01:00
James Munnelly
51195e4c5f Update license header and add header to every file
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
2018-08-13 15:53:37 +01:00
James Munnelly
3a69dd1cbf Update unit test fixture to produce mock Contexts 2018-08-07 16:13:46 +01:00