Commit Graph

167 Commits

Author SHA1 Message Date
Tim Ramlot
d72df08425
bump go 1.24.0 and fix 'usetesting' linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2025-06-05 03:16:46 +02:00
teslaedison
f56c664796 chore: fix some comments
Signed-off-by: teslaedison <qingchengqiushuang@gmail.com>
2025-03-13 10:56:03 +08:00
looklose
ff5bdf7ac8 refactor: use a more straightforward return value
Signed-off-by: looklose <shishuaiqun@yeah.net>
2025-02-27 11:30:48 +08:00
Tim Ramlot
4cf366ff0b
fix gosec G115 linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-09-11 13:30:56 +02:00
Richard Wall
e21a57a88c Enable metrics server on the webhook
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2024-07-19 17:04:52 +01:00
Tim Ramlot
52320fbeea
fix contextcheck linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-05-07 12:19:41 +02:00
Tim Ramlot
a8b5178fc5
fix dupword linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-04-29 13:47:25 +02:00
Tim Ramlot
9db044b232
fix gci linter
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-04-29 13:47:25 +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
23ab96de91
use unstructured.Unstructured in Mutation webhook
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-02-12 11:11:33 +01:00
Tim Ramlot
b9a216cdfc
Simplify webhook and switch Webhook to controller-runtime.
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-02-12 10:55:32 +01:00
Adam Talbot
a8bb63f0fc fix: move server package out of internal
Currently the TLS code here is imported by the approver-policy project. Long term we should break this code out to a new package, for now we can just move it out internal to unblock our ability to update the approver-policy imports.

Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
2024-02-07 11:31:17 +00:00
Tim Ramlot
899d55ae57
remove webhook conversion logic
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-02-02 11:19:08 +01:00
jetstack-bot
a1c134e78c
Merge pull request #6574 from ThatsMrTalbot/tls-metrics-endpoint
feat: add tls to metrics endpoint
2024-01-10 14:48:17 +00:00
Adam Talbot
d27fcc2762 refactor: refactored metrics server code into internal package
Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
2024-01-04 15:49:25 +00:00
Tim Ramlot
6458aaf518
stop using deprecated klog functions
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2024-01-03 16:18:35 +01:00
Richard Wall
036e3a8e74 Replace all uses of sets.String with the generic sets.Set
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2024-01-02 17:24:38 +00:00
Adam Talbot
ae143c15f6 feat: add tls to metrics endpoint
Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
2023-12-27 17:15:00 +00:00
jetstack-bot
c7714e65f0
Merge pull request #6551 from wallrj/gosec-601
Fix gosec G601: Implicit memory aliasing of items from a range statement
2023-12-20 18:21:37 +00:00
Richard Wall
4de9e956e5 Fix gosec G601: Implicit memory aliasing of items from a range statement
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2023-12-20 17:25:41 +00:00
Allen Mun
9b09aa87a7 Add flag and field to customize leaf duration on dynamic certificates
Signed-off-by: Allen Mun <allen.mun@capitalone.com>
2023-12-13 15:45:52 -05:00
Richard Wall
8bed166858 Add ReadHeaderTimeout to all http.Server where that setting is missing
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2023-12-07 11:42:22 +00:00
Tim Ramlot
073d90611e
limit webhook admission input
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-11-17 14:23:57 +01:00
Tim Ramlot
ef3bd7d3b2
upgrade all dependencies
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-09-28 12:07:27 +02:00
Tim Ramlot
cf8e37291a
replace k8s.io/utils/pointer with k8s.io/utils/ptr
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-08-28 09:33:10 +02:00
Tim Ramlot
31b5ed6620
Make webhook Logging options configurable using configfile.
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-08-17 12:00:50 +02:00
Tim Ramlot
b19d11d267
change the types of ports in the WebhookConfiguration:
internal: *int -> int32
public: *int -> *int32

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-08-15 20:53:58 +02:00
Cody W. Eilar
1243fe285b Add to ability to start controller with config file
Signed-off-by: Cody W. Eilar <ecody@vmware.com>
2023-07-27 16:44:38 -07:00
Luca Comellini
3ff638b6f3
Bump k8s.io dependencies
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2023-07-20 10:35:20 -07:00
Tim Ramlot
e7530880ce
use Version 3 for all Certificates and Version 0 for all CertificateRequests
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-11 10:21:55 +02:00
jetstack-bot
308c1472aa
Merge pull request #6031 from inteon/remove_deprecated_3
Replace deprecated wait.PollUntil and wait.Poll
2023-05-10 17:52:54 +01:00
Ashley Davis
209c252005
Move webhook testing package to core module
This package was used by at least one external importer [1] and so the
change to make the webhook live in a separate package caused an issue
which @irbekrm reported on slack. [2]

This PR moves the webhook testing code into the core cert-manager module
so it'll be importable anywhere (albeit under a new name). This change
also requires moving the webhook options into the core cert-manager
module since they're required by the webhook testing logic.

[1] 268cd2fdba/test/env/env.go (L25)

[2] https://kubernetes.slack.com/archives/CDEQJ0Q8M/p1683650224483169

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2023-05-09 18:40:03 +01:00
Tim Ramlot
e08a13496d
replace deprecated wait.PollUntil() and wait.Poll()
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-09 17:47:53 +02:00
Tim Ramlot
d656b2d9da
replace deprecated PollImmediateUntil with PollUntilContextCancel
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-07 10:15:46 +02:00
Luca Comellini
1bfc131e6a Bump sigs.k8s.io/controller-tools to v0.12.0
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2023-05-05 16:32:25 +01:00
Tobo Atchou
ee638a91ff cert-manager-webhook to provide logs when handling request
Signed-off-by: Tobo Atchou <tobo.atchou@gmail.com>
2023-04-22 10:41:44 +02:00
Tim Ramlot
415da885a1
remove ioutil
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-04-07 11:19:52 +02:00
Luca Comellini
0f64e055ae
Bump k8s.io dependencies
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2023-03-10 14:55:26 -08:00
Luca Comellini
dbd6dc9b16
Bump sigs.k8s.io deps
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-12-21 09:47:41 -08:00
Tim Ramlot
39fa9f51b4 upgrade dependencies
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-09-26 11:43:12 +02:00
Tim Ramlot
93caba980e apply go fmt for go1.19
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-08-04 09:51:57 +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
Ashley Davis
eccde015ac
add CRD generation to makefile, replacing bazel
- includes a run of make update-crds which causes some trivial changes
- updates version of YQ to latest
- makes hack/update-crds.sh just call make
- makes hack/verify-crds.sh just call make
- moves functionality of hack/verify-crds.sh to hack/check-crds.sh,
  using the makefile for generating alternative CRDs for comparison
- removes the bazel test associated with CRDs

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-27 13:25:18 +01:00
Luca Comellini
091549620b
Bump Go to 1.18
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-06-02 15:50:13 -07:00
Cody W. Eilar
2da5974fb4 Improve logging output for webhook cert renewal
- Make "cert-manager certificate" explicit in log output
- Include DNSNames for context

Signed-off-by: Cody W. Eilar <ecody@vmware.com>
2022-05-24 12:48:45 -07:00
Ashley Davis
6420aa4bfa
fix imports in a few files
this is according to our policy on organizing imports, see:
https://cert-manager.io/docs/contributing/coding-conventions/#organizing-imports

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-18 17:42:45 +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
James Munnelly
787ff34e38 Add copyright attribution
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-20 11:07:49 +00:00
James Munnelly
fa61625d5f Regenerate test CRDs
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-20 10:56:51 +00:00
James Munnelly
65b8994330 Avoid defaulting objects before validation
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-20 10:56:51 +00:00