Commit Graph

77 Commits

Author SHA1 Message Date
Tim Ramlot
0306731635
fix asasalint linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-04-29 17:45:07 +02:00
Tim Ramlot
23373e4323
correctly initialize loggers, create contexts and pass contexts
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-03-08 14:32:31 +01:00
Tim Ramlot
ffb47e52fa
remove dead & deprecated code from cert-manager codebase
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-02-10 17:22:23 +01:00
Tim Ramlot
04220447bc
remove deprecated files and functions
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-02-08 10:45:06 +01:00
Tim Ramlot
c584ee6dfb
use generics for mustAllSync variants
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-01-05 11:58:14 +01:00
Tim Ramlot
914c2dd169
add comments explaining the Sync function & small bugfixes
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-01-03 11:15:27 +01:00
Richard Wall
19ade4b79e Replace all calls to RandStringBytes and RandStringRunes
With k8s.io/apimachinery/pkg/util/rand#String instead

Signed-off-by: Richard Wall <richard.wall@venafi.com>
2024-01-02 15:41:07 +00:00
Richard Wall
4aa373b733 Deprecate RandStringBytes and RandStringRunes
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2024-01-02 15:02:14 +00:00
Richard Wall
d468830b23 Fix gosec G404
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2024-01-02 12:33:46 +00:00
Tim Ramlot
dc12a5d0a0
revert setting flags for logging tests
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-05 18:08:29 +02:00
Tim Ramlot
5091a3bff4
use same logging flags for every cli and simplify flag logic
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-05 18:08:29 +02:00
Michael Malov
99e23d5e93
Add support for json logging format
Signed-off-by: Michael Malov <14035243+malovme@users.noreply.github.com>
2023-05-05 18:01:16 +02:00
irbekrm
300fe72ff0 Code review
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-04-25 13:45:06 +01:00
irbekrm
0d1d66d900 Fixes tests
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-04-25 06:20:58 +01:00
irbekrm
7d592a8270 Swap upstream core informers factory with out wrapper
This does not actually change how the informers work. This also adds a partial metadata client to root context

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-03-22 09:03:16 +00:00
Tim Ramlot
836793e7e3 upgrade gateway api to v0.5.0
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-08-08 08:52:59 +00:00
Ashley Davis
fb231ab641
Remove bazel 🎉
This removes all .bazel and .bzl files, and a bunch of scripts relating
to bazel, now that it's been entirely replaced.

There are still a few places where traces could be removed, but this
removes the brunt of the bazel stuff that remains.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-26 11:38:50 +01:00
irbekrm
bcc691db08 Bump informerResyncPeriod
As minimum resync period in client-go is 1s. Also makes sure that the tests don't sleep for 'too long'.

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-07-04 08:52:02 +01:00
Richard Wall
557d14a0cd Refactor the update and updateStatus to a single deferred function
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2022-05-12 16:51:30 +01:00
Joakim Ahrlin
eb64e6494c
update deps and BUILD files
Signed-off-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
2022-03-01 15:05:18 +00:00
Jake Sanders
c96d91d586
Update the sig-network Gateway API support to v1alpha2
Co-authored-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-03-01 15:05:17 +00:00
Ashley Davis
3a055cc2f5
rename all uses of github.com/jetstack/cert-manager
This was done by running the following command twice:

 ```bash
 grep -Ri "github.com/jetstack/cert-manager" . | \
 cut -d":" -f1 | \
 sort | \
 uniq | \
 xargs sed -i
 "s/github.com\/jetstack\/cert-manager/github.com\/cert-manager\/cert-manager/"
 ```

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-02 09:08:31 +00:00
joshvanl
d89c3e71dc Update rest of controllers with ControllerFactory
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-27 12:51:49 +00:00
joshvanl
957bc0a081 Create InitWithRESTConfig() in controller test context builder to not
change existing Init() consumers

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
1319f2a5fb Adds the certificates SecretTemplate controller to reconcile ready
Certificate's Secrets on SecretTemplate changes

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
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
irbekrm
a42771b7e4 Adds a bunch of comments for exported types
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 10:19:43 +01:00
irbekrm
2cce594de1 Don't compare two booleans
Part of work towards fixing errors shown by static analysis tools

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 10:17:18 +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
Jake Sanders
196e42c221
Tidy godoc comments
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-05 16:21:24 +01:00
Jake Sanders
f194d9b732
Add godoc comments
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-05-05 15:59:02 +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
973f4aa424 Update codebase for external dependencies
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-09-26 12:52:43 +01:00
James Munnelly
ea5c111bca Add RegisterAdditionalSyncFuncs
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-08-22 13:11:33 +01:00