Commit Graph

206 Commits

Author SHA1 Message Date
James Munnelly
948a2cf77c Add more OWNERS files with auto-labels
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-24 19:38:31 +00:00
James Munnelly
8531947dc7 Bump chart version and fix chart test script
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-22 12:15:21 +00:00
James Munnelly
88cce30fbe Fix testenv for chart testing
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-18 13:40:11 +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
jetstack-bot
17118ccd6a
Merge pull request #1199 from munnerz/e2e-increase-resources
Increase resource requests and limits for cert-manager during e2e tests
2019-01-11 17:07:22 +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
James Munnelly
939b5c3fac Increase resource requests and limits for cert-manager during e2e tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-11 11:29:11 +00:00
James Munnelly
e9b735d1e2 Use pebble built by bazel during e2e tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-09 20:11:42 +00:00
Mike Bryant
018f3642e9 test: Add tests of second level ca issuer
This demonstrates that the certificates generated from an issuer 2 levels down do not validate

Signed-off-by: Mike Bryant <m@ocado.com>
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-09 11:39:48 +00:00
Mike Bryant
92d30c60c2 test: Verify certificates issued by the ca issuer
Use the standard X509 certificate validation to check that
generated certificates can be validated by clients

Signed-off-by: Mike Bryant <m@ocado.com>
2019-01-09 11:39:48 +00:00
Daniel Morsing
178c3044b2 remove liveness checks on pebble deployments in e2e tests
liveness checks are a feature in kubernetes meant to restart hung
workloads. Since pebble stores account information in-memory, failing
a liveness check means that any running test will fail.

Because we're using pebble as part of a testsuite, we're protected
against hangs by the test just timing out.

On resource constrained environments (like my laptop), I've seen
the liveness check fail during startup, causing reboot loops and
timeouts. Since rebooting pebble mid-test will cause tests to fail
anyhow, we should probably disable this check.

Signed-off-by: Daniel Morsing <dmo@jetstack.io>
2019-01-09 08:26:31 +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
jetstack-bot
ac8bd61da2
Merge pull request #1172 from munnerz/e2e-explore
Save global addon logs as CI artifacts & fixup logging
2019-01-08 15:38: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
3ac4d19874 Fix bug in challenge scheduler causing invalid results
Previously, we shared a single backing slice when
performing filter operations on slices, causing issues
when we perform sorting operations on that same
underlying slice.

Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-08 13:53:58 +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
e3e5612f95 Place global logs in log/ subdir
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 20:48:11 +00:00
James Munnelly
e46837f64c Replace calls to glog with GinkgoWriter
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 20:47:58 +00:00
James Munnelly
60e6755f3f Move util testing package into e2e/util
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 20:45:45 +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
6b76983165 Bump cert-manager verbosity during e2e tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2019-01-07 20:45:44 +00:00
James Munnelly
f4291d5876 Add missing call to GinkgoWriter.Write for global addon logs
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
07a137738b Fix helm chart verification lib
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-12-04 16:20:00 +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
b2dead1943 Fix potential race in e2e duration checking
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-28 21:30:20 +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
jetstack-bot
76f2eaff24
Merge pull request #1109 from munnerz/logs-on-failure
Print pod logs on e2e test case failure
2018-11-28 01:25:28 +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
James Munnelly
4232041710 Use test builder in ingress-shim units and fix tests
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-26 17:07:00 +00:00
jetstack-bot
9975ff4a8a
Merge pull request #1075 from gparvin/adding-not-after-to-certificate-status
changes to add a NotAfter field to the cert status
2018-11-16 10:11:01 +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
Gus Parvin
aceb997032 possible timing issue with the e2e test and the NotAfter status field
Signed-off-by: Gus Parvin <gparvin@us.ibm.com>
2018-11-14 16:34:52 +00:00
James Munnelly
93e886dfaa Fix v1alpha3 kind config
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-13 19:32:02 +00:00
James Munnelly
ed5ff98c9e Use appropriate kubeadm config version for kubernetes version
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-13 17:37:50 +00:00
Gus Parvin
7e33256b68 changes to add a NotAfter field to the cert status
Signed-off-by: Gus Parvin <gparvin@us.ibm.com>
2018-11-13 16:16:29 +00:00
James Munnelly
78f1718b86 Bump config template and kind image
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-09 11:47:34 +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
jetstack-bot
814a1d7d8e
Merge pull request #1012 from munnerz/e2e-crt-algo
Add e2e test verifying we can obtain ECDSA keys from RSA CA issuers
2018-11-07 16:47:45 +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
719dd915d1 Re-enable webhook during e2e tests and fix panic on start
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 16:06:49 +00:00
James Munnelly
544507f442 Update gofmt
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 12:39:36 +00:00
James Munnelly
cf402848b9 Add RSA/ECDSA unit tests for CA issuer
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 11:14:54 +00:00
James Munnelly
e7fd05ddea Add e2e test verifying we can obtain ECDSA keys from RSA CA issuers
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 11:14:54 +00:00
James Munnelly
17563ee1a1 Add Certificate and Issuer unit gen functions
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-07 09:56:09 +00:00
jetstack-bot
ac80ed82f1
Merge pull request #1046 from munnerz/logs-pkg
Revert "Remove pkg/logs package"
2018-11-07 09:48:55 +00:00
James Munnelly
175e90c158 Revert "Remove pkg/logs package"
This reverts commit b6f854f849.

Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 20:05:32 +00:00
James Munnelly
85d433cff9 Add ACME challenge scheduler and process challenges for matching domains/types in serial
Signed-off-by: James Munnelly <james@munnelly.eu>
2018-11-06 12:31:16 +00:00