Commit Graph

514 Commits

Author SHA1 Message Date
Ashley Davis
ca35696244
add make-based upgrade test
This uses cmctl instead of kubectl_cert-manager, uses make instead of
bazel and fixes an incorrect container name in
test/fixtures/upgrade/overlay/cainjector-ops.yaml

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-30 22:35:39 +01:00
Ashley Davis
642161a963
make update-all & ensure bazel-only targets are runnable
this allows us to maintain the bazel build files until they're removed,
but tries to avoid accidentally encouraging their use

`make update-all` implementes a non-bazel version of
`hack/update-all.sh`, with `hack/update-all.sh` now calling make but
also doing the bazel stuff it used to.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-30 12:47:30 +01:00
Ashley Davis
358785fb3d
remove now-replaced tests from hack/BUILD.bazel
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-28 09:28:01 +01:00
Ashley Davis
f8c1ebe2d8
add make verifier / updater for LICENSES
Uses go-licenses to create a CSV file which replaces LICENSES.

The replacement is much smaller and easier to parse for both humans
and for machines.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-28 09:27:54 +01:00
Ashley Davis
3c33140c11
remove bazel tests which are run in make
There's no need to run these twice in our presubmit tests

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-27 13:25:25 +01:00
Ashley Davis
eccde015ac
add CRD generation to makefile, replacing bazel
- includes a run of make update-crds which causes some trivial changes
- updates version of YQ to latest
- makes hack/update-crds.sh just call make
- makes hack/verify-crds.sh just call make
- moves functionality of hack/verify-crds.sh to hack/check-crds.sh,
  using the makefile for generating alternative CRDs for comparison
- removes the bazel test associated with CRDs

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-27 13:25:18 +01:00
Ashley Davis
22c0f45e22
add a make variant for codegen tools
- runs "make update-codegen"
- adds codegen verification to make tests
- changes hack/(update|verify)-codegen.sh to just call make
- removes bazel codegen test so it's not automatically run in CI

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-24 09:58:01 +01:00
Ashley Davis
c97914a40c
Don't include new bindir when generating bazel files
This could pick up files from vendored go and include them in bazel

We can't (easily) ignore "bin" also since we have other dirs called
"bin" which we don't want to ignore.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-21 16:34:31 +01:00
Ashley Davis
35f2206404
change name of bin dir to _bin by default and make it a variable
This is needed because go and other tools will ignore directories
starting with "_" or "." but would treat a dir called "bin" as a regular
directory.

This in turn meant that when we vendored Go in bin, these tools would by
default scan the whole stdlib included with the bundled vendored go.

See https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns for details

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-21 16:34:26 +01:00
jetstack-bot
448a0832bf
Merge pull request #5190 from irbekrm/kind_1_24
Bump kind, use upstream 1.24 image
2022-06-09 19:34:33 +01:00
irbekrm
36984671dd Adds a couple comments and TODOs
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-06-09 16:54:38 +01:00
irbekrm
cdc8c1ce36 Bumps kind to 0.14, use upstream kube 1.24 image
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-06-09 16:53:20 +01:00
Ashley Davis
9b9e8015b8
prefix failed goimports files to make errors clearer
also uses tabs everywhere in the file rather than a mix

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-09 15:49:10 +01:00
Alessandro Vermeulen
1da01211ee Feature gated support for using literal subjects in Certificates
Signed-off-by: Alessandro Vermeulen <alessandro.vermeulen@ing.com>
2022-06-08 20:50:00 +02:00
irbekrm
10e117c59d Removes 1.18 and 1.19 kind images
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-06-08 13:32:48 +01:00
Luca Comellini
091549620b
Bump Go to 1.18
Signed-off-by: Luca Comellini <luca.com@gmail.com>
2022-06-02 15:50:13 -07:00
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