Commit Graph

498 Commits

Author SHA1 Message Date
Ashley Davis
a691a0807b
maintain a single source of truth for updating kind images
this removes the update functionality from make/cluster.sh in favour of
the simpler logic in hack/latest-kind-images.sh

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 16:35:25 +01:00
Ashley Davis
e41dc00956
use a version sort for proper version comparisons
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 15:22:27 +01:00
Ashley Davis
a15b662b92
use command -v over which
command is more portable

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 15:22:02 +01:00
Ashley Davis
7a7a3951ed
ignore bin directory in various verification scripts
these scripts would choke in various ways on a vendored copy of go

ignoring `bin` is the correct behaviour anyway, and should speed up
running the scripts

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 12:18:35 +01:00
Ashley Davis
c205b4d74f
make verify-chart-version respect CTR in makefile
this allows podman to be used instead of docker

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 12:10:36 +01:00
irbekrm
689ddcafa2 Cleanup + a couple TODOs
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-05-10 12:05:02 +01:00
irbekrm
66aef8d582 Bumps kind v0.11.1 -> v0.12.0
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-05-09 17:45:11 +01:00
Irbe Krumina
1d917ef311 Revert "Use Apply instead of Update to modify resources in tests"
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-05-03 11:31:47 +01:00
jetstack-bot
eb76f331ad
Merge pull request #5077 from irbekrm/tests_apply
Use Apply instead of Update to modify resources in tests
2022-04-29 13:23:00 +01:00
jetstack-bot
3897556ccc
Merge pull request #4721 from Dean-Coakley/remove-securityContext-enabled
Remove `securityContext.enabled` from helm chart
2022-04-28 17:39:24 +01:00
irbekrm
46233e5012 ./hack/update-all.sh
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-04-28 14:51:44 +01:00
Luca Comellini
931adfb493
Bump golang.org/x/crypto to v0.0.0-20220411220226-7b82a4e95df4
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-04-26 16:47:10 +02:00
Ashley Davis
7ea4496dcb
Gracefully handle 404s when fetching old CRDs
If we're in the middle of a cert-manager release we'll have a git tag
created for that release, but won't have a GitHub release created yet.
That means that an attempt to download old CRDs for our versionchecker
test will fail for that version, with a 404 error.

An alternative approach would be to use the GitHub API to query for
existing non-draft releases - but that introduces a new point of failure
whereby we can easily hit a rate limit, or else introduces the need for
a GitHub API token.

The GitHub API also has the issue that it doesn't present every release
in one API call, which complicates fetching releases using curl and uses
even more rate-limit capacity.

The approach here is simple; we ignore tags for which the release 404s,
download manifests for which the release gives a 200, and bubble up any
other errors.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-30 15:16:17 +01:00
jetstack-bot
dc24503939
Merge pull request #4958 from irbekrm/tsig_provider
Use our own implementation of miekg/dns.TsigProvider interface
2022-03-22 12:18:51 +00:00
irbekrm
4c901aefab Code review comments
Adds test conditions to certs via patch API call instead of update to avoid conflicts

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-21 07:33:51 +00:00
irbekrm
3a21f961ca Use our own implementation of github.com/miekg/dns.TsigProvider interface
To allow us to both upgrade the upstream library and keep supporting HMACMD5 as RFC2136 TSIG algorithm although it was deprecated in the upstream library

Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-21 07:09:29 +00:00
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
Dean Coakley
c17b11fa01 Remove securityContext.enabled from helm chart
`securityContext.enabled` was deprecated and has already been replaced by
`securityContext` which supports arbitrary yaml.

Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com>
2022-01-08 08:26:44 +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