Commit Graph

36 Commits

Author SHA1 Message Date
Tim Ramlot
4c94f3ef10
create ad-hoc schemes instead of sharing global ones
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-11-06 21:58:24 +01:00
Tim Ramlot
cf8e37291a
replace k8s.io/utils/pointer with k8s.io/utils/ptr
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-08-28 09:33:10 +02:00
Ashley Davis
209c252005
Move webhook testing package to core module
This package was used by at least one external importer [1] and so the
change to make the webhook live in a separate package caused an issue
which @irbekrm reported on slack. [2]

This PR moves the webhook testing code into the core cert-manager module
so it'll be importable anywhere (albeit under a new name). This change
also requires moving the webhook options into the core cert-manager
module since they're required by the webhook testing logic.

[1] 268cd2fdba/test/env/env.go (L25)

[2] https://kubernetes.slack.com/archives/CDEQJ0Q8M/p1683650224483169

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2023-05-09 18:40:03 +01:00
irbekrm
206b6def1e Make external DNS webhook tests importable again
Signed-off-by: irbekrm <irbekrm@gmail.com>
2023-05-04 12:40:06 +01:00
Tim Ramlot
415da885a1
remove ioutil
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
2023-04-07 11:19:52 +02:00
Ashley Davis
6ce6ae839e
separate binaries/tests into separate modules with minimal dependencies
also add gomod validation in CI, along with a cmrel version bump

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2023-04-05 10:30:39 +01:00
Ashley Davis
eb6c29756d
Refactor CRD provisioning for integration tests
Falls back to looking in bin/crds if nothing has been provisioned in
bazel.

Removes "bazel.go" and consolidates in "paths.go", since the bazel name
will become obsolete and the functionality has changed

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-02-17 14:48:56 +00: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
James Munnelly
d03d98967d Fix webhook kubernetes config in integration tests
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-20 10:56:50 +00:00
James Munnelly
708de3c580 webhook: use new admission-plugin backed validation and mutation handlers
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-20 10:56:46 +00:00
James Munnelly
8ff84e8b70 Re-organise and extend path loading logic to make it easier to run integration tests using Delve/GoLand
Signed-off-by: James Munnelly <jmunnelly@apple.com>
2022-01-06 15:22:39 +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
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
irbekrm
81bdabf67a Code review feedback
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 17:23:42 +01:00
irbekrm
5ff6e2d789 Changes required to use envtest from controller-runtime v0.10
Environment.CRDs is now a slice of apiextensionsv1.CustomResourceDefinitions instead of client.Object https://github.com/kubernetes-sigs/controller-runtime/pull/1626#discussion_r684454763

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-09-30 10:13:29 +01:00
Richard Wall
481fc5e43a Force the "served: true" in the CRDs when used in integration tests
These tests still need to create legacy API versions.

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
2021-09-29 14:32:35 +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
Inteon
91ec4c773a
use correct contexts everywhere & don't restart apiserver to add crds
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-12 20:05:01 +02:00
Inteon
8ec405e823
fail if stop was not successful
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-07 00:17:02 +02:00
Inteon
a569e79776
cleanup test contexts
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-06 17:31:19 +02:00
joshvanl
d261e2eadb Defined AdmissionReviewVersions:[]string{"v1"} in API webhook
configuration integration tests

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-29 14:54:17 +01:00
joshvanl
58519e442a Change admissionregistration.k8s.io v1beta1 to v1 in integration tests
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-26 16:26:45 +01:00
Inteon
cd92bf321f
centralise testing api-server & remove custom implementation
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-06 16:13:44 +02:00
Tamal Saha
b1cb6422e4 Use controller-runtime v0.9.0-beta.0
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-05-17 08:11:19 -07:00
joshvanl
109b3e0b28 Rename Wehook's API server host flag from --master to --api-server-host
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-26 17:26:28 +00:00
joshvanl
f640f64fcb Update integration test framework to restart the API to share the
address with the webhook

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-26 17:26:28 +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
Mateusz Gozdek
8fc98a4422
test/integration/framework: simplify to avoid word "datas"
As it is being treated as a typo by codespell.

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-07 14:53:55 +01:00
Maartje Eyskens
614d8496ad Update int test server
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-14 19:25:15 +02:00
Maartje Eyskens
5049c1a4ab Improve integration tests with OpenAPI + webhook validation
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-08-13 15:01:50 +02:00
James Munnelly
1ec1a07b72 surpress control plane output during integration tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-06-23 16:48:33 +01:00
James Munnelly
e88aab9953 Split with newlines
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-04-07 14:35:51 +01:00
James Munnelly
3f9c031f5d Update integration & unit tests for new CRD generation
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-04-01 18:22:35 +01:00
Maartje Eyskens
2236d1a271 Patch issue where runtime.Object is needed
Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
2020-03-13 15:51:14 +01:00
James Munnelly
4e5f9bc31d Add integration testing framework and a basic conversion test
Signed-off-by: James Munnelly <james@munnelly.eu>
2020-03-13 15:32:50 +01:00