Commit Graph

481 Commits

Author SHA1 Message Date
irbekrm
587e02cee9 Replaces dns v0.41 -> v0.34
This is so as to avoid dropping support for HMacMD5 value for issuer.spec.acme.solvers.dns01.rfc2136.tsigAlgorithm

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-17 20:14:55 +00:00
irbekrm
ad746fae10 Bumps a bunch of deps
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-17 20:14:55 +00:00
Ashley Davis
a30540806e
minor verify-goimports tweak + document future improvements
checks args for a better error message, and writes informational
messages to stderr

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-05 16:37:26 +00:00
Ashley Davis
89d7742c56
add verify-errexit target to ci presubmits
Also modifies the script to run without bazel, and tweaks it so that
it'll detect errors in itself too.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-05 16:37:26 +00: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
Maël Valais
c09dbb07e4 make: speed up 'docker build' with separate dir contexts
Previously, we had one .dockerignore that would do its best to only have
the binaries and licenses copied into the Docker (or nerdctl, or
buildah). Unfortunately, that meant it had to copy all of bin/server and
bin/cmctl, which could become quite large (I measured 1.6 GB).

Instead of relying on a single .dockerignore file, we copy the licenses
and binaries into a "scratch context" directory. The downside is that
all the binaries are in two different places (bin/server and
bin/scratch/containers). Note that we can't use symlinks because Docker
won't dereference them.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-02-25 16:38:53 +01:00
Ashley Davis
a57110c6bb
Add targets for unit and integration tests in make
These lean heavily on `go test` for everything possible.

Also adds setup for versionchecker test in make, and a script for
extracting CRDs from templated rendered YAML files

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-17 14:48:57 +00:00
Maël Valais
3817f7d023 makefile: create images using UID=1000, like what Bazel does
Signed-off-by: Maël Valais <mael@vls.dev>
2022-02-15 16:29:07 +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
jetstack-bot
fed2465b50
Merge pull request #4766 from wallrj/4765-gengo-output-base
Specify an --output-base directory for all the gengo tools
2022-01-21 11:55:07 +00:00
Richard Wall
35b905303c Specify and output-base directory for all the gengo tools
By default they were writing the generated files to $GOPATH if set.
(which it was on my laptop)

```
$ deepcopy-gen -h 2>&1 | grep output-base
  -o, --output-base string               Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set. (default "/home/richard/go/src")
```

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2022-01-20 17:10:48 +00:00
Richard Wall
f0849676e8 bazel run //hack:update-deps
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2022-01-20 15:26:18 +00:00
Ashley Davis
72027ce622
bump chart-testing image version to v3.5.0
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-10 18:02:25 +00:00
Ashley Davis
ad998b35f8
Allow helm chart verification in both bazel + make
This slightly modifies our existing helm chart verification script to
accept the location of a tarball containing the chart we're verifying.

That in turn allows us to more generally use the script for both
validating the chart we build using make and the chart we build using
bazel.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-10 18:02:14 +00:00
Ashley Davis
5a5c94a3f1
match upstream boilerplate verification for files w/ go:build
the regex being replaced doesn't match files which only contain go:build
although as of go 1.17 (which we require for cert-manager) that's
totally valid.

this commit updates the regex to match upstream k8s, which is the
original source of the boilerplate verification script in any case

upstream:
47ff335d4c/hack/boilerplate/boilerplate.py (L219-L223)

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-06 14:57:21 +00:00
Ashley Davis
1b3ac23659
add goimports verification and skeleton ci presubmit check
CI check will be built upon as Make is improved to reach testing partiy
with bazel

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-05 15:28:38 +00:00
irbekrm
e58ca97245 Uses upstream kind image with kube 1.23
Also bumps kind image for kube 1.22

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-12-22 15:38:45 +00:00
James Munnelly
8f1fb874ed Run update-codegen in module mode
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-12-17 18:13:44 +00:00
James Munnelly
81f22fd49c Upgrade k8s.io dependencies to v0.23.1
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-12-17 16:27:47 +00:00
jetstack-bot
3b3e661d7f
Merge pull request #4669 from munnerz/update-runc
Update runc dependency to 1.0.3
2021-12-17 11:20:13 +00:00
jetstack-bot
0b8eba629c
Merge pull request #4554 from SgtCoDFish/maker
Makefile flow
2021-12-17 10:37:13 +00:00
James Munnelly
2041994b12 Update runc dependency to 1.0.3
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-12-16 15:45:25 +00:00
Richard Wall
36c4de9881 Update import paths
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-12-16 11:11:04 +00:00
Richard Wall
50f376130f Don't generate client code for deprecated API versions
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-12-15 16:29:51 +00:00
Ashley Davis
32d716654a
Add a makefile flow for building artifacts
Includes targets for:

- all "server" binaries, for all arches
- all containers for all server binaries for all arches
- all client binaries (kubectl plugin / cmctl) for all arches
- the cert-manager helm chart + signature
- the cert-manager static manifests + CRDs
- tools which bazel would download, with checksum verification
- (commented out) a signed SHA256SUM file for client binaries

Upgrades from the bazel flow include that:

- we use OS-specific base images rather than just using amd64 everywhere
- we easily add support for signing artifacts at build time
- we add ".exe" to the end of windows executables
- we add a zip file for windows executables, for easier consumption
- we concatenate YAML files more robustly
- staging a full release should be much faster
- hopefully, it's easier to change things!
- licenses are trimmed down to reduce bloat in images (the license
  bundle was 1.4MB in size alone)

Changes from the bazel flow include:

- containers no longer have a symlink to the binary at an unusual
  path, but instead just have the binary at a more predictable path
  (e.g. /app/cmd/webhook/webhook instead of
  /app/cmd/webhook/webhook.runfiles/com_github_jetstack_cert_manager/cmd/webhook/webhook_/webhook)

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-12-15 09:54:15 +00:00
Ashley Davis
6734e9b746
add scripts for sha256 sum calculations
hash.sh returns just the sha256sum of its input file

checkhash.sh uses ha.sh to get the sha256sum of its first argument and
then validates that the checksum matches the value provided in its
second argument

hash.sh isn't currently fully portable since sha256sum isn't present
by default on macOS, but it provides a single point around which we can
do hashing to validate checksums

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-12-15 09:54:15 +00:00
Ashley Davis
7a99e7c834
add script for writing make variables for base images
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-12-15 09:54:12 +00:00
Richard Wall
4eedf4fcfd Test conversion code using sample CRDs and remove conversion configuration from cert-manager CRDs
* Generate CRDs for the sample API types
* Allow alternative CRDs to be loaded into the envtest API server
* Override the conversion configuration of the CRDs
* Show webhook server logs in tests
* Simplify the loading of the test API CRDs
* Allow the ConversionHandler to be overridden in tests

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-12-14 17:33:22 +00:00
James Munnelly
1a96d9f32d config.cert-manager.io -> webhook.config.cert-manager.io
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-12-01 12:57:08 +00:00
James Munnelly
fb81666e56 Add config.cert-manager.io API group
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-11-26 14:12:54 +00:00
Jake Sanders
43583e13b3
Update bazel repos
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2021-11-23 16:58:59 +00:00
Ashley Davis
6f8ef26c07
add a script + flow for getting latest kind images
the script will need to be manually updated if we want to add a new
k8s version, but it should be trivial to do that

the actual kind image SHAsums aren't updated, so that the addition of
the script can be separate from the act of updating the images

also adds a make target for creating a kind cluster with CI deps

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-11-08 16:58:16 +00:00
irbekrm
edd7304c6c Bumps timeout to wait for cm api in upgrade test
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-11-02 11:19:05 +02:00
Ashley Davis
bfecde8116
update keystore-go library version
Following the release of cert-manager v1.6.0, it was observed that an
update to the keystore-go library was backwards-incompatible; it
introduced a 6-character minimum length on passwords which wasn't
previously in force.

This led to https://github.com/pavel-v-chernykh/keystore-go/issues/30
which in turn led to https://github.com/pavel-v-chernykh/keystore-go/pull/31

This commit bumps to use the new version, which by default doesn't have
a min password length

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-10-28 10:10:45 +01:00
James Munnelly
b2353bee4b Update codegen script to remove workarounds
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-10-21 15:43:50 +01:00
James Munnelly
e7dea9f2a2 Replace all references to pkg/internal with internal
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-10-21 12:27:04 +01:00
irbekrm
264c45c276 Identifies the version to upgrade to by commit
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-18 13:54:22 +03:00
irbekrm
c9f1a5dbdf Fix the script that finds last published release
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-18 08:55:57 +03:00
irbekrm
598ed35e4a Uses go/crypto ListCertAlternates function to fetch alternative certificate chains
This allows us to use upstream go/crypto again instead of our own fork

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-07 15:21:26 +01:00
Richard Wall
cf3092f8c5 ./hack/update-all.sh
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-10-07 09:16:16 +01:00
jetstack-bot
f41310a82d
Merge pull request #4485 from munnerz/m1-support
Add support for building all Bazel targets on M1 macs
2021-10-01 14:03:35 +01:00
Richard Wall
38fbd6cf4f ./hack/update-all.sh
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-10-01 12:41:15 +01:00
James Munnelly
093313390b Add support for building all Bazel targets on M1 macs
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2021-10-01 11:48:22 +01:00
Richard Wall
00e0090ce7 ./hack/update-all.sh
Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-10-01 10:22:35 +01:00
irbekrm
81bdabf67a Code review feedback
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 17:23:42 +01:00
irbekrm
7319d3392a Load kyverno image with Bazel
So that we don't pull the same image for each test run.

Also run helm install with --debug so that it outputs more information.

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 10:14:26 +01:00
irbekrm
577757f282 Adds the new format of Go build tags to verify_boilerplate
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 10:08:30 +01:00
irbekrm
cb6a746726 Runs ./hack/update-all.sh
New format of Go build tags gets added

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 10:08:19 +01:00
irbekrm
0889570722 Ensures conversion code temp workaround works for Go 1.17
Also refactor

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 10:08:09 +01:00
irbekrm
0679c33c3f Update kube libraries, regenerate go.mod/go.sum
Updates go.mod for Go 1.17

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 10:07:59 +01:00