Commit Graph

47 Commits

Author SHA1 Message Date
jetstack-bot
88bda66693
Merge pull request #5345 from inteon/ginkgo_v2
Upgrade to Ginkgo v2
2022-08-04 21:06:15 +01:00
Tim Ramlot
9897f2355c upgrade ginkgo to v2
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2022-08-04 10:16:29 +00:00
Ashley Davis
ea9a46a16a
add trivy scan targets
These enable scanning of each of our container images on linux/amd64
to check for vulnerabilities. These targets can then be used in CI as
an indicator that we might need to take a look at upgrading dependencies
or base images.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-08-03 15:57:28 +01:00
Ashley Davis
ba415c2df3
add missing target for $(BINDIR)
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-11 15:41:45 +01:00
Maël Valais
24e1ba51a6
make: cmctl and kubectl-cert_manager were using two -ldflags
I also took the opportunity to document the three most important "build"
variables in "make help".

Manually rebased to adopt $(BINDIR) changes

Signed-off-by: Maël Valais <mael@vls.dev>
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-11 10:18:30 +01:00
Ashley Davis
e18908fb56
Use variable for curl, add retries
This adds multiple retries on every attempt we make to use curl, which
should help to reduce flakes. Uses a $(CURL) variable where possible so
that we have the same invocation everywhere.

Also switches to using the more verbose curl arguments, in an attempt to
make it easier to reason about how curl is configured.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-06 12:38:14 +01:00
Ashley Davis
cdfcc63951
check gatewayapi SHA256SUM
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-04 15:02:36 +01:00
Ashley Davis
59c7f881ff
use new darwin-arm64 versions of kubebuilder tools
previously we'd relied on rosetta because these tools hadn't been built
for darwin-arm64, but now they've started to be built and we can use
arm64 versions directly

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-07-04 15:02:36 +01:00
jetstack-bot
5a4e7654d4
Merge pull request #5097 from lucacome/bump-k8s-deps
Bump k8s.io dependencies
2022-07-04 14:44:45 +01:00
irbekrm
1c48a7351d Bump versions of kubebuilder assets and kubectl
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-07-01 19:16:31 +01:00
Ashley Davis
18e98ce3da
move legacy targets to legacy.mk
we don't _need_ to remove these and we can keep them around for
longer, but we don't need them to be in files we actually use and edit.

putting the targets in a separate file feels cleaner!

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-30 22:35:45 +01:00
Ashley Davis
27e1a770b3
add warning about vendor-go gotcha
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-30 22:33:56 +01:00
Ashley Davis
2c9344e316
Don't require python to be installed for everything
We only use python in one place and probably won't start using it more
without some kind of policy change. We don't need to require that everyone
has it installed, and can instead only require it for people who're running
the boilerplate check

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-28 15:57:39 +01:00
Ashley Davis
b3a3f61fbf
add install for go-licenses
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-27 18:15:08 +01:00
Ashley Davis
c6745ea7a9
move VENDORED_GO_VERSION up with other versions
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-27 18:15:07 +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
7230ff85a5
add extra info on how to fix when tools are missing
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-24 09:54:57 +01:00
Ashley Davis
52b94bb5a3
bump version of k8s-codegen assets
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-24 09:54:52 +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
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
9e51a14be1
add install for rclone
this will be used in place of gsutil to upload staged releases to GCS

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-06-09 15:49:11 +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
irbekrm
e89b2b1423 Don't fail when removing a non-existant tar
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-05-13 16:35:16 +01:00
jetstack-bot
9a95de7aec
Merge pull request #5119 from SgtCoDFish/latestkind
Maintain a single source of truth for updating kind images
2022-05-11 17:54:55 +01: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
7ce1f9cffb
Improve "make help" output and add a couple of utility commands
- "make help" should be good enough for most people in most situations
  to build and test cert-manager
- "make clean-all" can be a one-stop-shop to start fresh.
- "make which-go" makes it clearer whether go vendoring is being used

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-05-11 13:35:28 +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
Ashley Davis
d43a5e8eb8
use absolute path of cmrel
fixes the breakage created by https://github.com/cert-manager/cert-manager/pull/4988

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-29 11:26:52 +01:00
Maël Valais
15c19384b7 make: prevent "warning: undefined variable 'CI'"
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-29 11:26:37 +02:00
Maël Valais
ae0632c1f0 make: add "make e2e-setup-kind-update-images"
I think having a separate file for storing the various kind image
digest isn't necessary. From now on, make/cluster.sh is the "source of
truth" for everything related to kind. If you would like to see the
image that is going to be used for creating the kind cluster, you can
run:

  make/cluster.sh --show-image

To self-update the digests with the latest available digests, run:

  make/cluster.sh --update-images

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-29 11:26:37 +02:00
Maël Valais
6c57633884 make: remove the not-really-needed system dependency "perl"
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-29 10:54:26 +02:00
Maël Valais
904a00fefb make: tools version is now properly switched when switching branches
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-25 18:03:35 +01:00
Maël Valais
c6f1f9bc24 make: in CI, copy binaries from "bin/downlaoded" to "bin/tools"
This is to work around the fact that binaries in hostPath-mounted
directories cannot be executed even if the permissions are correct.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-25 18:01:54 +01:00
Maël Valais
48a31521b3 make: vendor-go wasn't run before e2e-setup
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-15 15:55:19 +01:00
Maël Valais
7003a26baa make: remove 'how to install system tools' instructions such as go or jq
I had written instructions that would show up when you don't have one of
the mandatory system tools such as go or jq. After some feedback, I
decided to remove these instructions since we are concerned that these
instructions may become out of date.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-13 12:32:08 +01:00
Maël Valais
3405edf821 make: add the targets 'e2e-setup-kind', 'e2e-setup-kind', and 'e2e'
The commands can be run concurrently, with the exception of e2e that
has to be run after e2e-setup is done. The e2e target does not check
whether cert-manager and the addons are installed.

The two only scripts that were kept are:

- make/e2e.sh      (previously called ./devel/run-e2e.sh)
- make/cluster.sh  (previsouly called ./devel/cluster/create.sh)

The reason for the removal of the other scripts is that they didn't
have that much logic and could easily ported to Make, improving greatly
the execution speed thanks to make's concurrency.

make/e2e.sh now behaves "as expected" when using -ginkgo.focus or
GINKGO_FOCUS; previously, the logs would not be shown before the end
of the test.

make/cluster.sh has lost the ability to create an OpenShift 3.11 cluster.
for running the end-to-end tests. The two reasons are that OpenShift 4
wasn't supported by the script devel/cluster/create.sh, and OpenShift
3.11 is not supported by cert-manager anymore.

The Makefile targets that were used in the Prow jobs (verify, verify_deps,
verify_chart, verify_upgrade, and cluster) have been kept around. They
now show a warning to encourage people to use the new Make-based targets.
When running one of the deprecated targets the Makefile won't check the
presence of the system tools such as Go and jq, since Bazel takes care of
these dependencies.

On version change, downloaded tools and images are re-downloaded. The
command 'make clean' now keeps the downloaded images and tools.

Note that a lot of attention has been put into having a Make system that works
flawlessly both on Linux and on BSDs (such as macOS).

You will note that some recursive calls to make are made, and $(MAKE)
instead of plain "make" is used in that case. If we didn't use $(MAKE),
we would have concurrency issues, and warnings such as:

  make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-13 12:32:08 +01:00
Ashley Davis
216f95f563
add install for controller-gen and other "gen" tools
k8s codegen tools are a bit of a special case; this is explained in a
comment.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-03-05 17:18:50 +00: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
Ashley Davis
5972243f3e
add gotestsum, a tool for prettier log output
can also do junit xml output if we care about that

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-17 14:48:56 +00:00
Ashley Davis
74841280ed
add kubebuilder tools in make for integration tests
Note that darwin/arm64 has to be special cased currently because of a
lack of official support for that platform in upstream etcd and
kube-apiserver. We instead install the amd64 versions, which is what
we did for bazel.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-17 12:04:53 +00:00
Ashley Davis
168b47f1b0
install ginkgo version from go.mod, rather than explicit ver
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-06 16:53:36 +00:00
Ashley Davis
80648321f8
add install for ginkgo, used for e2e tests
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-06 14:06:29 +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
Ashley Davis
5a261d789a
move checksum verification to tool target over temp target (#4678)
when on temp target, the object being verified will still be written and
so a second invocation of `make tools` will succeed and install an
unverified version

For more information see attached issue

Fixes #4678

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-12-20 14:39:59 +00:00
Ashley Davis
ef26e7974e
always embed version number into temporary downloaded tools artifacts
Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2021-12-20 14:35:40 +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