Commit Graph

55 Commits

Author SHA1 Message Date
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
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
David Bond
4a4dd03245
Switch leader election to use Lease objects
Previously, cert-manager supported both ConfigMap & Lease objects for leader election. This commit modifies
the leader-election code to now solely use Lease objects in both the controller & ca-injector. The related
RBAC for ConfigMap resources has also been removed.

This change means that you cannot upgrade to the version containing this commit from cert-manager 1.3.

Related to #3766

Signed-off-by: David Bond <davidsbond93@gmail.com>
2022-03-10 12:38:50 +00:00
joshvanl
0bba16e0f9 Adds empty feature set for cainjector. Parses feature gates in devel
script, and passes them on to each component

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-07 14:39:46 +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
DiptoChakrabarty
b0e2264b60 add go linters
Signed-off-by: DiptoChakrabarty <diptochuck123@gmail.com>
2022-01-13 00:12:15 +05:30
irbekrm
f4452f1cfa Fix some flag descriptions
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-12-31 09:15:32 +00:00
irbekrm
c58b73edeb Pprof can be optionally run for cainjector
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-26 12:21:21 +03:00
joshvanl
64feb85490 Adds bazel to build and release cmctl, along with kubectl-cert_manager
binary

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-10-14 15:49:46 +01:00
Johan Fleury
ef32714434
Make leader election defaults consistent
Signed-off-by: Johan Fleury <jfleury@arcaik.net>
2021-08-13 12:14:40 -04:00
Inteon
78d13787e6
remove duplicated error messages & cobra help messages on error
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-28 15:55:14 +02:00
Inteon
d430113666
remove os.Exit from cert-manager controller and make sure LeaderElection ReleaseOnCancel works
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-27 21:40:42 +02:00
Inteon
48e9c2bd16
exit with exit code 0 on cancel & release leader-election on cancel
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-27 19:43:08 +02:00
Inteon
d6cd6f457d
set correct exit codes when exiting
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-22 12:57:08 +02:00
irbekrm
4413774944 Removes unused Bazel deps
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-01 08:49:30 +01:00
irbekrm
d79a058b14 Allow controlling whether cgo is enabled via flags to Bazel
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-01 08:47:06 +01:00
Tamal Saha
7b63788f52 Cleanup codegen script
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-05-17 08:11:19 -07:00
irbekrm
34fd9e9fef Makes /cmd/cainjector/main more DRY
reuses util.ContextWithStopCh to create a context with cancel func

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-01-27 13:32:23 +00:00
Julien ALEXANDRE
f8fbea38b3
Add flags to configure cainjector leader election
This commit enables users to customize the behavior of the cainjector
regarding leader election by adding `--leader-election-lease-duration`,
`--leader-election-renew-deadline` and `--leader-election-retry-period`
flags. These flags are already available on the controller.

Prior to this change, the values of these options were inherited from
controller-runtime. This commit keeps the same defaults for the
cainjector, for backward compatibility, even though they differ from
those of the controller.

Signed-off-by: Julien ALEXANDRE <22328659+ndrpnt@users.noreply.github.com>
2020-12-19 18:00:54 +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
Richard Wall
c3e79865ca Exit(1) and explain what causes the context to be cancelled
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:24:10 +01:00
Richard Wall
392ed06cfc Explain why we start the two controllers in separate goroutines
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:21:21 +01:00
Richard Wall
4fd5cd6b3c Avoid launching controller goroutines during shutdown of unelected
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-18 10:15:14 +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
b772f3295b Use cancellable contexts and errgroups
...to control the starting and stopping of controllers and caches

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-17 09:37:05 +01:00
Richard Wall
81874895b0 Use NewUnmanaged and separate caches for each controller
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-11 10:09:27 +01:00
Richard Wall
bcff4edb0f Run both controllers in a single goroutine with a single manager
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-10 13:54:50 +01:00
Richard Wall
ba02ea4120 Revert "Refactor the cainjector to only have 1 leader election"
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-09-04 16:54:16 +01:00
Maartje Eyskens
8b7552cec1 Refactor the cainjector to only have 1 leader election
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-17 11:16:48 +02:00
Maartje Eyskens
3259fdfe9b Implement feedback
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens
827ce9c5ad Revert log levels on errors
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:42 +02:00
Maartje Eyskens
5d4869b20e Fix formatted logs
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens
fecd0b3518 Set all log levels for info
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
Maartje Eyskens
9dd00905e9 Update klog
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>

klog v2

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-12 10:59:41 +02:00
JoshVanL
0657e34396
Moves cobra commands from cmd -> app
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-04-30 12:14:51 +01:00
JoshVanL
dcccdd39c5
Adds doc generation for cobra controlled ctl comands
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-04-30 12:14:48 +01:00
jetstack-bot
fba7b09ac8
Merge pull request #2725 from JoshVanL/ctl-version
cert-manager-ctl CLI with version
2020-04-08 12:45:15 +01:00
JoshVanL
49d3bde7eb
Move cmd signal handler into shared util
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2020-04-02 11:02:33 +01:00
James Munnelly
e36c1acf1c Add '-ubi' suffix to AppVersion in UBI artifacts
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-04-01 19:34:34 +01:00
James Munnelly
0935277f3d Remove old 'image' targets and update to consistently use //build targets
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-03-17 09:47:01 +00:00
James Munnelly
22f4f1e1f2 Add release-tars targets to construct cert-manager release artifacts
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-01-30 21:02:58 +00:00
James Munnelly
5057da1b89 Add Bazel image targets with coverage enabled
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-10-16 08:59:24 +01:00
James Munnelly
fad13bfce1 Move image macro into hack/build
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-09-27 12:07:08 +01: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
dd66c11115 Extend cainjector to support injecting from secrets
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-08-14 12:57:01 +01:00
James Munnelly
5a096b0b07 Fix lint failures and remove image target manual tag
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-02 18:26:12 +01:00
James Munnelly
de34f0410d Use binary image targets to avoid building multiple architectures all the time
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-02 17:29:32 +01:00
James Munnelly
fd2dd16f75 Change bazel build to only build for current --platform
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-07-02 16:10:05 +01:00
James Munnelly
500d8fbeb7 Create image bundles in multiarch_image target
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-05-03 11:16:25 +01:00