Commit Graph

89 Commits

Author SHA1 Message Date
Richard Wall
8f9ccf3b42 Reduce memory usage by only caching the metadata of Secret resources
Signed-off-by: Richard Wall <richard.wall@venafi.com>
2024-07-10 10:07:18 +01:00
deterclosed
e50052aded chore: remove repetitive words
Signed-off-by: deterclosed <fliter@outlook.com>
2024-03-23 13:37:59 +08: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
jetstack-bot
0b9366c0fb
Merge pull request #6232 from inteon/fix_log_reassignment
[BUGFIX] Incorrect re-assignment of cross-invocation variable
2023-07-26 13:35:07 +02:00
Ashley Davis
7e1ce241ac
use supplied context where possible
this was discovered as part of the investigation into #6104

Signed-off-by: Ashley Davis <ashley.davis@venafi.com>
2023-07-26 11:06:31 +01:00
Tim Ramlot
c7d0e0a13e
instead of creating a new local log variable, we were updating the cross-invocation log variable and were adding more Values to the log variable, causing high memory usage and incorrect log messages
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-07-25 20:31:47 +02:00
cui fliter
4723347260 fix function name in comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-07 17:17:07 +08:00
irbekrm
3d1134a975 Update cainjector inejctable setup
To work with latest controller runtime

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-05-05 16:32:25 +01:00
Tim Ramlot
a3dbd22752
only apply patch if patch is != nil
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-05 15:01:57 +02:00
Tim Ramlot
bce882b477
use cainjector feature flags
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-03 19:52:13 +02:00
Tim Ramlot
4d81f1877a
resolve feedback
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-05-03 11:18:10 +02:00
Tim Ramlot
927cef3c22
switch to SSA for cainjector
Co-authored-by: joshvanl <vleeuwenjoshua@gmail.com>
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-04-26 17:04:11 +02:00
irbekrm
56cf4dfd3c Allows to modify configured injectable kinds for cainjector via flags
Also changes name of --watch-certs flag to --enable-certificate-data-source

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-02-01 11:43:00 +00:00
irbekrm
0c64cebfc5 Rename injector.go -> injectables.go
To reduce the variations of naming

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-02-01 11:43:00 +00:00
irbekrm
767aa39ddb Simplify injectable logic
Reduce the amount of interfaces enclosing the injectable instance from 3 to 1. Also some minor renaming and comments cleanup

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-02-01 11:43:00 +00:00
irbekrm
3e58a442b7 Cleanup reconciler logic
Make the file structure and struct naming more intuitive, add some comments

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-02-01 11:43:00 +00:00
irbekrm
74b258c3be Code review feedback
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-02-01 08:53:27 +00:00
irbekrm
7e4dea1c2e Clarify the error message when secret annotation is missing namespace prefix
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-31 11:12:31 +00:00
irbekrm
24040c4989 Ensure that updates to injectables are caught
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-31 10:49:56 +00:00
irbekrm
a174f0faa4 Filter injectables that trigger reconciles
Only trigger reconciles for events on injectable types that are annotated, not random unrelated resources

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-30 11:27:15 +00:00
irbekrm
7a5c71a1ed Cleanup, better comments
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-30 11:26:07 +00:00
irbekrm
3aba8ed32d Makes cainjector Certificate watch optional
Configurable via a flag, true by default

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-24 13:52:45 +00:00
irbekrm
4776597cb4 Remove the double cache mechanism for cainjector
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-23 17:38:46 +00:00
irbekrm
ff80030737 Log error if CA source is in a namespace that is not in scope
cainjector will still watch cluster-scoped resources such as CRDs, so it can get references to Secrets or Certificates in namespaces that are out of scope

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-06 10:09:36 +00:00
irbekrm
87bef52337 Fix cainjector's namespace flag
Ensures that when cainjector has the namespace flag passed, namespaced resource caching is scoped to that namespace

Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-01-05 18:15:19 +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
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
Eng Zer Jun
54e70d2cc4
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated in Go 1.16. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-08-23 19:50:42 +08:00
Tamal Saha
7b63788f52 Cleanup codegen script
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-05-17 08:11:19 -07:00
Tamal Saha
b1cb6422e4 Use controller-runtime v0.9.0-beta.0
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-05-17 08:11:19 -07:00
jetstack-bot
6ad91e0700
Merge pull request #3833 from JoshVanL/controller-issuer-context
Pass context through to client calls in controllers and acme issuer
2021-04-06 18:53:57 +01:00
Richard Wall
20510e45f0 Update cainjector to use stable API versions
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-04-01 17:23:28 +01:00
joshvanl
18ae2295f9 Pass context through to client calls in controllers and acme issuer
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-31 20:34:12 +01:00
Matt Turner
44f69ce015 Minor log message clarification
Supplying just a name, rather than a namespace/name, for a cainjector
source reference, results in the generic error message "invalid
certificate name". This condition is detected on its own branch so we
can be more specific.

Signed-off-by: Matt Turner <matturner@gmail.com>
2021-01-07 19:21:11 +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
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
Richard Wall
0a2a4b0d7a Revert the introduction of errors.WithStack
* The logging isn't configured to show the stack traces anyway.

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 12:08:10 +01:00
Richard Wall
ea73ab534c Document newIndependentCacheAndDelegatingClient
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 12:02:52 +01:00
Richard Wall
35f10ef439 Explain why we're not using the controller.Builder
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 11:58:30 +01:00
Richard Wall
975e98e285 Log an error if WaitForCacheSync fails
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 11:51:45 +01:00
Richard Wall
a5e6f6c262 Stop creating new controllers if one of the errgroup has already erred
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 11:41:11 +01:00
Richard Wall
602043013e Revert the increased number of reconcile threads
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 11:39:52 +01:00
Richard Wall
2bffaf9270 A clearer name for the function which creates each controller
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 11:38:00 +01:00
Richard Wall
7c6374ff07 Explain why we ignore objects with a deletionTimestamp
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:28:32 +01:00
Richard Wall
e2765f720a Remove debug log
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:04:28 +01:00
Richard Wall
e27e503624 Ensure that each controller's delegating client refers to the correct cache
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 08:29:07 +01:00
Richard Wall
98fff7dcf8 Clearer logging
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-17 16:43:15 +01:00
Richard Wall
1bb99dee1a Increase the number of reconciler goroutines
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-17 16:42:51 +01:00
Richard Wall
ebd7ba5e70 Ignore objects that are being deleted
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-17 16:41:58 +01:00