Commit Graph

181 Commits

Author SHA1 Message Date
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
joshvanl
4d40bdcd96 Fix tests after metrics comment changes.
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-12-07 07:42:27 +00:00
joshvanl
b4f2d4982b Ensure clockTimeSecondsGauge is registered. Updates metrics integration
tests to include gauge clock metric

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-12-02 12:11:20 +00:00
jetstack-bot
5eabeb0020
Merge pull request #4520 from mcaci/lint
Remove t.Fatal from goroutine
2021-10-26 13:02:40 +01:00
irbekrm
7b6eeff457 Profiler address for controller can now be configured
Ensures that pprof is configured for controller in the same way as for cainjector

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-10-26 12:20:42 +03:00
Michele Caci
ac4bf927c2 Remove t.Fatal from goroutine
Signed-off-by: Michele Caci <michele.caci@amadeus.com>
2021-10-19 12:53:46 +02: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
jetstack-bot
898dc0e254
Merge pull request #4419 from artificial-aidan/master
Add Certificate RenewBefore prometheus metrics
2021-09-27 17:51:46 +01:00
Aidan Jensen
3bd35642a7
Use status.renewalTime instead of renewBefore
Signed-off-by: Aidan Jensen <aidan@artificial.com>
2021-09-01 10:07:21 -07:00
Aidan Jensen
c6bc180f58
Add Certificate RenewBefore prometheus metrics
Signed-off-by: Aidan Jensen <aidan@artificial.com>
2021-08-30 10:52:21 -07:00
joshvanl
4cdbb64003 Update ctl integration tests to use new local factory package
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-08-24 16:37:01 +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
e5df60d47e
don't wait for hooks in kubectl cert-manager x install test & use local chart for tests
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-11 23:18:33 +02:00
Inteon
abc39053b2
resolve .Stop() failures
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-08-07 10:19:07 +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
jetstack-bot
25320ceaa8
Merge pull request #4252 from JoshVanL/admissionregistration-v1beta1-v1
Change admissionregistration.k8s.io v1beta1 to v1 in integration tests
2021-07-29 20:44:41 +01:00
joshvanl
1d926e8e50 Adds UserInfo fields to conversion webhook tests
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-07-29 17:35:13 +01: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
jetstack-bot
d062176777
Merge pull request #4243 from inteon/improved_go_routines
Cleanup goroutine management
2021-07-28 15:36:41 +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
jetstack-bot
77c5c2fb16
Merge pull request #4184 from inteon/kubectl_certmanager_install_tests
Add basic tests to kubectl cert-manager x install
2021-07-23 16:16:19 +01:00
Inteon
81e216eeba
wait for goroutines to end before exiting
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:30:26 +02:00
Inteon
769e057663
metrics server simplify
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:30:02 +02:00
Inteon
0ed0135930
Improvements based on reviewer's feedback
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-23 15:29:43 +02:00
Lars Lehtonen
dccda3b321
test/integration/acme: fix dropped error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2021-07-13 04:39:04 -07:00
Inteon
611bac67cf
Add basic test cases
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-08 16:28:38 +02:00
Inteon
e2ce115738
also reset ManagedFields in test
Signed-off-by: Inteon <42113979+inteon@users.noreply.github.com>
2021-07-06 16:56:31 +02: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
kit837
51fe108beb Fix metrics_controller integration test.
Signed-off-by: kit837 <66801824+kit837@users.noreply.github.com>
2021-06-15 19:26:55 +00:00
kit837
0f97e6d19d pass in clock.Clock for better test
Signed-off-by: kit837 <66801824+kit837@users.noreply.github.com>
2021-06-15 17:48:20 +00:00
irbekrm
e6b748047d Remove the default renewBefore value
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-06-11 10:03:12 +01:00
irbekrm
06f6b46f30 Implements feedback from code review
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:20:05 +01:00
irbekrm
bbfd2294f9 Integration test for ACME Orders controller
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:11:48 +01:00
irbekrm
d8c941da8e Refactors creation of ACME Orders controller
So that it easier used with the existing test framework and also is more similar to how most other controllers are created

Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-05-19 13:11:18 +01:00
Tamal Saha
7b63788f52 Cleanup codegen script
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-05-17 08:11:19 -07: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
Lars Lehtonen
635dc187f5
test/integration/certificates: fix dropped error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2021-04-12 05:45:57 -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
jetstack-bot
a8c75fab1a
Merge pull request #3773 from JoshVanL/certificate-revision-history-limit
Certificate revision history limit
2021-03-26 11:13:58 +00:00
joshvanl
d5ccbdb277 Fix test controller name of revision manager in integration test
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-23 15:58:35 +00:00
Maël Valais
71e707387a trigger-controller: refactor test, inject gatherer and policychain
Injecting the whole Gatherer struct was not necessary for testing
since DataForCertificate is now fully unit-tested. With that, we
can mock the Gatherer.Evaluate function. Since there is no reason
to inject a full Gatherer object into the trigger controller, I chose
to inject a simple policies.Func. I named the function "shouldReissue"
since this is exactly what this function does.

I also refactored the test cases to use the same gen.Certificate
that we use in the rest of the codebase.

Signed-off-by: Maël Valais <mael@vls.dev>
2021-03-23 13:55:11 +01:00
joshvanl
2a08d8a8df Adds integration tests for revision manager
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2021-03-15 14:54:34 +00:00
jetstack-bot
70c66e02a0
Merge pull request #3641 from JoshVanL/certificate-request-identity
CertificateRequest UserInfo fields
2021-03-15 14:26:15 +00:00
irbekrm
a89133b637 Better wording and wrap long comment lines.
Co-authored-by: Maël Valais <mael@vls.dev>
Signed-off-by: irbekrm <irbekrm@gmail.com>
2021-03-15 08:48:23 +00:00