Commit Graph

79 Commits

Author SHA1 Message Date
James Munnelly
420ebfebe2 Use goflag instead of pflag for logs
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-12 14:24:51 +00:00
James Munnelly
5d73076db9 Update logs package for go-logr
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-12 14:24:50 +00:00
James Munnelly
7a20d32ebd Add Venafi e2e suite
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-03-01 13:16:03 +00:00
jetstack-bot
c07bfd7181
Merge pull request #1419 from DanielMorsing/enable_httpstest
Enable https redirect test
2019-02-28 15:05:11 +00:00
Daniel Morsing
f4b132c8c6 enabled https redirect test
Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-02-28 12:25:03 +00:00
Daniel Morsing
e1cee57b32 update dependencies for test
We use the latest pebble release without the strict mode flag enabled

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-02-28 12:24:24 +00:00
jetstack-bot
ccd2dd8533
Merge pull request #1398 from DirectXMan12/feature/ca-controllers
Add a CA Injector Controller
2019-02-27 14:59:44 +00:00
Solly Ross
42248a91d7 CA Injector Controller
This implements a CA injector controller using controller-runtime.
It looks at admission webhooks and APIServices with a particular
annotation, and injects the CA data from certificates.

Signed-off-by: Solly Ross <sollyross@google.com>
2019-02-26 21:47:34 -08:00
Daniel Morsing
2d21983486 Implement test for HTTP->HTTPS redirects during ACME HTTP01 challenges (#1303)
* Add test for http->https redirects

This makes sure that when we're handling http->https redirects like
letsencrypt/boulder would for acme HTTP-01 validations

Signed-off-by: Daniel Morsing <dmo@jetstack.io>

* add initial TLS cert in hopes that this will make the TLS redirect work

Signed-off-by: Daniel Morsing <dmo@jetstack.io>

* make nginx-ingress not cheat on redirects

Signed-off-by: Daniel Morsing <dmo@jetstack.io>

* skip test until nginx-ingress is fixed

Signed-off-by: Daniel Morsing <dmo@jetstack.io>

* run bazel update

Signed-off-by: Daniel Morsing <dmo@jetstack.io>

* gofmt

Signed-off-by: Daniel Morsing <dmo@jetstack.io>

* reenable no-tls-redirects

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-02-25 15:01:19 +00:00
James Munnelly
b9a0c51933 Don't return errors if retrieving pod logs fails
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-22 17:11:10 +00:00
James Munnelly
1f48f3d1d4 gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:56 +00:00
James Munnelly
e20c3ffb82 Fix test/e2e/util for new pkg/api/util package
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-19 11:25:56 +00:00
James Munnelly
18c6191b0b Create HaveCondition gomega matcher and use it in e2e test
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-02-08 13:40:07 +00:00
James Munnelly
f9a228c86e Use new kubectl var everywhere
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-31 23:00:44 +00:00
James Munnelly
b16484e95d Wait for Certificate to become not-ready before waiting to become ready
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-31 22:25:46 +00:00
James Munnelly
31eeb5fe2a Refactor WaitCertificateValidTLS and run kubectl describe on test failure
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-31 22:25:46 +00:00
Zadkiel Aharonian
9fe05cc3d2
Fix references for chart path
Signed-off-by: Zadkiel Aharonian <hello@zadkiel.fr>
2019-01-17 18:56:47 +01:00
Daniel Morsing
f428e0b848 only init globals data once
This fixes the issue of global addons not being cleaned up after tests

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-14 15:48:16 +00:00
James Munnelly
ec87b60c94 Use Bazel images for nginx-ingress, vault and tiller
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-11 14:03:22 +00:00
jetstack-bot
d8b7c734bc
Merge pull request #1110 from munnerz/helm-ginkgo-writer
Use GinkgoWriter to print Helm install output
2019-01-08 19:12:30 +00:00
James Munnelly
8533a5b91c Use log.Logf instead of GinkgoWriter
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-08 14:55:27 +00:00
James Munnelly
016ae6077f Print test namespace name at the start of all test specs
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 22:16:33 +00:00
James Munnelly
2d55a8fa26 Use framework/log instead of glog
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 22:14:04 +00:00
James Munnelly
0237d5a4c2 Write log files to artifacts directory instead of stdout
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 20:45:44 +00:00
James Munnelly
0fcc0c666c Update copyright header year
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 15:07:55 +00:00
James Munnelly
5a17c58c03 Rearrange Helm charts into deploy/ and test/e2e/charts directories
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-12-04 16:19:49 +00:00
James Munnelly
b205852949 Use GinkgoWriter to print Helm install output
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 11:35:53 +00:00
James Munnelly
2d28270d9f Print pod logs on e2e test case failure
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-27 14:21:25 +00:00
Max Ehrlich
bbd9249198 Configurable issuer duration and renewBefore Take 2 (#893)
* Configurable issuer duration and renewBefore [1/3]

This is part one of (probably) three parts manually moving the changes from commit 723015174a167d746323f506ab3575cfb243d8bd to the new master. This commit moves the basic functionality of configurable duration while skipping e2e tests and docs. It does not include new work.

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [2/3]

This commit moves over most of the e2e testing updates, some things are intentionally left out as they may be obsolete

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Configurable issuer duration and renewBefore [3/3]

This commit moves the documentation changes, completely the migration of the original code to the latest master

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning all hack scripts with since the massive bazel update

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate headers

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun codegen hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning update-docs hack

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix failing unit tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix build errors in e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun update-deps

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Don't recreate the CA issuer, it already exists

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Need to create new issuers for the duration and renew time tests because those fields are set in the issuer, so make sure they are named uniquely

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add duration e2e tests for vault w/ custom mount path

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add validation to disallow acme certificates with duration and renewBefore set and update unit tests to verify

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to mention duration/renew for self-signed issuer and fix potential parsing errors with rst formatting

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Self-signed issuer was missing duration validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a bug causing certificates with a short enough renew-before w.r.t their duration to be renewed instantly and forever

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Print the exact time until renewal

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move duration and renwal validation to the issuer validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to work with new validation

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add e2e test for the self-signed issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Redo cert duration and renew before to appear as part of the CSR and not the issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Updating tests to match new duration/renewbefore format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests to match new format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update docs to reflect changing the field from issuers to certificates

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove event firing and replace with a TODO as of discussion on PR

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Run hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove the sync unit test since without events there is no way to catch the warnings that it was testing

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Use IssuerOptions RenewBeforeExpiryDuration if certificates dont set a renewBefore value for immediate renewal checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Delete check on certificate data length in e2e test for certificate duration as there is no reason it should be there

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Update e2e tests since certificate creation will never generate an event

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hack scripts after big rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix a few problems that slipped through during the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix an e2e error that resulted from the rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add unit test for the calculateTimeBeforeExpiry function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Adding back in a bunch of missing error checks

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused function

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add missing boilerplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove unused constant

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move log constants to function body

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerun hack scripts

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove mistakenly commited file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove double-import of util package

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in e2e vault issuer

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change duration and renewBefore to be pointer fields as they are optional

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Remove wrong vault issuer test that got passed the rebase somehow

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e to use pointer format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e cert tests out of issuer test file

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Move e2e self-signed issuer test to new location

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Make sure to check for nil in GenerateTemplate

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Add more empty checks to be safe

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Rerunning hacks after rebase

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix bad function call in new e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Try not setting duration and renewbefore on acme e2e tests

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Zero checks should really just be replaced by nil tests, zero should be caught as any other too-small value

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fixed a missing nil check that got away

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Change e2e duration test format to use pointer times to better simulate API calls

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix sync unit test to match e2e test format

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Fix vault e2e test

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>

* Revert changes to Certificate sync function

Signed-off-by: James Munnelly <james@munnelly.eu>

* Remove selfsigned e2e issuer.go

Signed-off-by: James Munnelly <james@munnelly.eu>

* Don't use ACME issuer in duration example and tidy up line endings

Signed-off-by: James Munnelly <james@munnelly.eu>

* Allow renewBefore to be set on ACME certificates

Signed-off-by: James Munnelly <james@munnelly.eu>

* Update renewBefore ACME docs. Remove unused fields.

Signed-off-by: James Munnelly <james@munnelly.eu>

* Rename calculateTimeBeforeExpiry to calculateDurationUntilRenew

Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-14 22:30:00 +00:00
jetstack-bot
25c1c126c8
Merge pull request #1052 from munnerz/webhook-panic
Re-enable webhook during e2e tests and fix panic on start
2018-11-07 17:11:46 +00:00
James Munnelly
51d950692c Update pod started checker to tolerate PodCompleted
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 16:14:57 +00:00
James Munnelly
544507f442 Update gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 12:39:36 +00:00
jetstack-bot
7292937057
Merge pull request #1010 from munnerz/tiller-e2e-notice
e2e: remove old notice about Tiller addon
2018-10-26 02:07:39 +01:00
James Munnelly
f402c674bb
Update PodStartTimeout
This is to try and reduce test flakes relating to pod start timeouts during e2e's

Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-25 22:55:27 +01:00
James Munnelly
1bec153073 e2e: remove old notice about Tiller addon
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-25 18:58:24 +01:00
jetstack-bot
0d4c45d303
Merge pull request #988 from munnerz/cf-creds
Don't fail e2e's if cloudflare dns01 credentials are not provided
2018-10-23 19:33:01 +01:00
James Munnelly
ca8d4cd085 Add WaitForAllPodsRunningInNamespace function as an addon helper
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 18:45:55 +01:00
James Munnelly
748da93d85 Use --wait flag when installing e2e charts
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 14:48:10 +01:00
James Munnelly
44b588b192 Load cloudflare credentials from environment instead of CLI args
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 14:36:46 +01:00
James Munnelly
5be82139d4 Add SkipError type
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 14:24:38 +01:00
James Munnelly
af2faef241 Fix using Bazel built helm during e2e tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-23 01:40:08 +01:00
James Munnelly
dc3eedda8f Create Addon as an exported var in addon package
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-19 11:41:11 +01:00
James Munnelly
6fb9858e17 Fix CA issuer ClusterIssuer e2e test
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 15:07:55 +01:00
James Munnelly
8562dfa897 Use unique domains in all HTTP01 and DNS01 tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 14:47:54 +01:00
James Munnelly
f8f4d003ec Add --report-prefix option
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 14:38:45 +01:00
James Munnelly
b60138c082 Fix waiting for test pods to become ready
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 14:19:05 +01:00
James Munnelly
d37a7ecd99 Run helm init --client-only during tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 13:27:05 +01:00
James Munnelly
4665c1c022 Update boilerplate headers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 13:27:05 +01:00
James Munnelly
ecda543dcb Refactor e2e test framework
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-10-18 13:27:05 +01:00
William Lightning
3d09d98bd7 extract rbacClusterRoleHasAccessToResource out of certificate_rbac test to test framework util
Signed-off-by: William Lightning <wlightning@fuelmedical.com>
2018-09-19 10:19:04 -07:00