Commit Graph

59 Commits

Author SHA1 Message Date
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
Monis Khan
2a33c7a5c2
Use Kubernetes CSR spec.expirationSeconds to express cert duration
This change adds the ability to express certificate duration using
the Kubernetes CSR spec.expirationSeconds field alongside the existing
approach of using the experimental.cert-manager.io/request-duration
annotation.  Both approaches are supported as the expirationSeconds
field requires Kubernetes v1.22+.

Signed-off-by: Monis Khan <mok@vmware.com>
2022-03-21 09:40:32 -04: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
joshvanl
ce1424162e Updates all sub commands to discover the CLI name using the build
package name

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-10-14 14:45:01 +01:00
joshvanl
bae35d8adb Add ValidArgs functions to all commands to allow auto-completion of
runtime object names

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-10-14 13:20:31 +01:00
joshvanl
20c1de7626 Update all commands to no longer receive a factory, and instead use the
shared local factory package

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-08-24 16:30:44 +01: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
joshvanl
1f4343d98e Move exported cmd util func to package where it is used. Removes util
package

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-28 14:25:17 +01:00
joshvanl
3eccfaaa94 Adds review comments for adding supported versions, writing to stdout,
removing error wraping

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-06-18 11:58:24 +01:00
joshvanl
331e178f60 Wires up ctl x create csr command
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-06-15 15:37:28 +01:00
joshvanl
02666fde10 Adds create CertificateSingingRequest form Certificate command
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-06-15 15:17:35 +01:00
irbekrm
1abc7107ca Passes a single context with cancel func to all the kubectl plugin commands
Signed-off-by: irbekrm <irbekrm@gmail.com>

Don't duplicate the existing ContextWithStopCh function

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-01-27 13:06:34 +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
1254179f3a Use V1 API resources in ctl create certificaterequest tests
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 17:12:15 +01:00
Richard Wall
bd94bf92a5 cmapiv1 > cmapi
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:06 +01:00
Richard Wall
b638954b03 Fix ./cmd/ctl and tests
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:06 +01:00
Richard Wall
81eb53f597 ./hack/update-all.sh
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:28:06 +01:00
Richard Wall
a70298180a Run a script to update v1alpha2 usage to v1
Script is available at https://github.com/jetstack/cert-manager/pull/3201

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2020-08-20 14:26:51 +01:00
Haoxiang Zhou
57ff60e35c Added more unit tests for Run function
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-22 17:29:47 +01:00
Haoxiang Zhou
d65e95eaeb Refactor TestCtlCreateCRBehaviourBeforeAnythingIsCreated to unit tests
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-22 16:51:48 +01:00
Haoxiang Zhou
f061f15e93 Review implementations
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-21 15:57:02 +01:00
Haoxiang Zhou
f5aeb56400 Validate errors if from-certificate-file flag is empty
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-17 17:48:02 +01:00
Haoxiang Zhou
28b9e4ba48 Added unit tests for Validate
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-17 17:47:50 +01:00
Haoxiang Zhou
8b89873199 Smaller review implementations
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-17 13:53:39 +01:00
Haoxiang Zhou
864bb3ab59 Command output to stderr, check both ready condition and length of status.certificate
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
e74d0fd954 Refactor Fetch function to have no API call
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
16a1d927e4 Fixed bug of assigning to new variable instead of correct one
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
2a2c637d3a Error when Ready condition is true but status.certificate is empty
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
76272f8acd Inline polling/waiting for CR to be ready
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
492fd623ec Changed flag to output-certificate-file
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
735be40fdc Improved help output
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
c2c62fe124 Added flag to specify timeout when waiting on certificate
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
9583f7c0a3 Use %w to format errors, clean-up
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
6580010a14 Store certificate to file if flags are set
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
a421e5beb5 Added flags to wait for, fetch and store certificate from CR
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-07-10 13:23:52 +01:00
Haoxiang Zhou
8db33a0c43 Use ctl.Scheme instead of webhook.Scheme
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-26 12:02:49 +01:00
Haoxiang Zhou
a98240c6f9 Changed directory set-up for tests, review changes
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-18 16:47:10 +01:00
Haoxiang Zhou
a628f62f2c Changed flag to from-certificate-file
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-16 12:30:28 +01:00
Haoxiang Zhou
3b7284973c Wrtie key to file before creating CR and changed key file permission
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-16 12:24:18 +01:00
Haoxiang Zhou
1a01120fbd Make name of CR a required argument, changed tests accordingly
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-16 12:19:46 +01:00
Haoxiang Zhou
de787796b7 Review changes
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-15 14:22:55 +01:00
Haoxiang Zhou
5a5c3ce053 Change to only have -f flag
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-11 17:30:59 +01:00
Haoxiang Zhou
023177108c Moved subcommand certificaterequest to its own package
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-11 14:00:29 +01:00
Haoxiang Zhou
60ea8ff78f Review changes, update description and function name
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-11 13:32:46 +01:00
Haoxiang Zhou
4b135540d4 Store private key in file, added flag to specify file name.
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-05 10:26:37 +01:00
Haoxiang Zhou
378521300a Add argument check, example uses; cleanup
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-04 10:12:17 +01:00
Haoxiang Zhou
19e489c59a Move use of factory out of Run func
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-04 09:14:40 +01:00
Haoxiang Zhou
0e3a355873 Use first arg as name of CR if supplied.
Signed-off-by: Haoxiang Zhou <haoxiang.zhou@jetstack.io>
2020-06-04 09:14:40 +01:00