Commit Graph

667 Commits

Author SHA1 Message Date
irbekrm
ac956abb0c Fix CR approve/deny e2e test for kube 1.24
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-05-10 12:07:29 +01:00
Irbe Krumina
1d917ef311 Revert "Use Apply instead of Update to modify resources in tests"
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-05-03 11:31:47 +01:00
irbekrm
58b633aa04 Code review feedback
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-04-29 12:42:41 +01:00
irbekrm
d6e684bc8a e2e tests use SSA to update test resources
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-04-28 14:49:30 +01:00
Maël Valais
2205bafef5 e2e: WaitForAllPodsRunningInNamespaceTimeout: %s missing value in logs
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-29 10:54:26 +02:00
Maël Valais
be093559cb e2e: raise slightly the timeouts so that ginkgo -nodes 20 works
Moving from -nodes 10 to -nodes 20 has lowered the e2e time from 35 to
30 minutes on n1-standard-8 with a request (for the prow job pod) of
3500m (the memory limit of 12Gi is never reached).

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-29 10:45:08 +02:00
Maël Valais
d6ebdda49c make/e2e.sh: add a backoff to the log.Logf when waiting for something
Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-29 10:45:08 +02:00
Monis Khan
2a33c7a5c2
Use Kubernetes CSR spec.expirationSeconds to express cert duration
This change adds the ability to express certificate duration using
the Kubernetes CSR spec.expirationSeconds field alongside the existing
approach of using the experimental.cert-manager.io/request-duration
annotation.  Both approaches are supported as the expirationSeconds
field requires Kubernetes v1.22+.

Signed-off-by: Monis Khan <mok@vmware.com>
2022-03-21 09:40:32 -04:00
jetstack-bot
af47ae4e5b
Merge pull request #4914 from maelvls/install.mk
Make: move the end-to-end tests from Bazel to Make with the new commands "make e2e-setup" and "make e2e"
2022-03-17 09:00:35 +00:00
jetstack-bot
be9f2aeafa
Merge pull request #4925 from maelvls/fix-another-flakiness
Retry on conflict for the end-to-end test "CA Injector for api services should update data when the certificate changes"
2022-03-16 14:12:35 +00:00
jetstack-bot
d60a5cf7d6
Merge pull request #4924 from maelvls/fix-flakiness
Retry on conflict for the end-to-end test "added an additional dnsName"
2022-03-16 13:36:35 +00: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
Maël Valais
ebe3b39c65 e2e: remove annoying "Running with unsupported features: Ed25519"
The messages "Running test suite with unsupported features: <list>" was
initially meant to remind us, in case of failure, why a given test would
be failing (i.e., it could be failing due to a set of supported features
too wide or too restrictive). This message should only show on failures;
as it is, it is not actionabe since it does not mention which issuer is
being tested. Removing this log line improves the user experience of
running the Ginkgo suite: the green dots, signifying a passing test, are
not interleaved with these messages.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-13 12:13:39 +01:00
Maël Valais
5fad0e6de4 e2e: remove annoying "Configuring details for shared cluster addons"
The Ginkgo logs would be constantly printing this message. Since this
message does not contain any actionable information, I figured we could
remove it. As a consequence, the user experience of running the Ginkgo
suite has slightly improved, since the green dots (signifying a passing
test) aren't interleaved with these messages.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-13 12:11:35 +01:00
irbekrm
e1e416aa6f Remvoes the creation of an unused HTTPRoute in tests
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-12 16:22:33 +00:00
irbekrm
cdaeb0599a Removes the creation of the unused test istio GatewayClass
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-12 16:13:06 +00:00
irbekrm
1e4c2e378b Explicitly specify group name in test gateway cert ref
Signed-off-by: irbekrm <irbekrm@gmail.com>
2022-03-12 16:09:29 +00:00
Tathagata Paul
3fb21d156c add more e2e tests for issuer ready state in conformance tests
Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>
2022-03-08 19:14:31 +05:30
Maël Valais
6b7262ba93 e2e: retry on conflict for the test "added an additional dnsName"
The test:

    [Conformance] Certificates with issuer type ACME DNS01 Issuer should allow updating an existing certificate with a new dns name

was flaky due to an update that was not properly retried on conflict.
The error was:

    Operation cannot be fulfilled on certificates.cert-manager.io \"testcert\": the object has been modified

This error appeared in 127 different prow jobs.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-07 18:41:43 +01:00
Maël Valais
6620f4b024 e2e: fix flakiness: "CA Injector should update data when the certificate changes"
The error:

    Operation cannot be fulfilled on certificates.cert-manager.io "serving-certs"

has appeared in 162 different prow builds in the past.

Signed-off-by: Maël Valais <mael@vls.dev>
2022-03-07 18:41:07 +01:00
Tathagata Paul
6503f4f83c e2e for issuers and cluster issuers ready state
Signed-off-by: Tathagata Paul <tathagatapaul7@gmail.com>
2022-03-03 19:15:36 +05:30
Jake Sanders
74ddda40cb
goimports
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-03-01 15:27:33 +00:00
Jake Sanders
10979e1e27
Tidy imports and copyright preamble
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-03-01 15:05:25 +00:00
Jake Sanders
72efaad2b2
Protocol type must be TCP, Listeners must have a name
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-03-01 15:05:22 +00:00
Jake Sanders
c08f46711a
Add contour, weed out some more references to v1alpha1
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-03-01 15:05:19 +00:00
Joakim Ahrlin
eb64e6494c
update deps and BUILD files
Signed-off-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
2022-03-01 15:05:18 +00:00
Jake Sanders
c96d91d586
Update the sig-network Gateway API support to v1alpha2
Co-authored-by: Joakim Ahrlin <joakim.ahrlin@gmail.com>
Signed-off-by: Jake Sanders <i@am.so-aweso.me>
2022-03-01 15:05:17 +00:00
joshvanl
566582956a Adds Gateway API feature gate check to certificate suite conformance test
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-14 12:41:09 +00:00
joshvanl
d3052a81e4 Require Gateway API feature gate for Gateway API tests. Add a helper
func

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-14 11:51:15 +00:00
joshvanl
82346f9027 Adds check in additionaloutputformat e2e test suite for ServerSideApply
which is required to be enabled

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-11 17:07:25 +00:00
joshvanl
19b68c9ba2 Update SecretTemplate comments on policy checks
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-07 15:02:51 +00:00
joshvanl
d5365af662 Adds e2e tests for additional output formats
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-02-07 14:43:25 +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
joshvanl
1df5afc028 Update secret template e2e test for new issuing controller field manager
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-27 12:51:49 +00:00
joshvanl
c18571a78d Remove json tags from internal API types.
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-18 14:04:53 +00:00
jetstack-bot
051a763ee5
Merge pull request #4638 from JoshVanL/controllers-certificates-secret-template
SecretTemplate reconciliation. SecretManager Apply
2022-01-18 13:28:57 +00:00
Ashley Davis
f2d8a33dd7
Add a build tag for the e2e test only
This was initially part of #4565 which was closed in favour of moving
integration tests, but the consensus was that the e2e test is a special
case.

The e2e test requires so much more ahead-of-time setup that our bazel
build flow special cases it by marking it manual. This is a `go test`
equivalent to that, which enables the e2e test to remain under the test/
directory while still allowing `go test ./test/...` to work generally
for all other tests.

We'll add make targets for the e2e tests down the road. For now, we add
the build tag and define it in bazel so this commit should be a no-op
in effect.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
2022-01-17 15:32:30 +00:00
joshvanl
b6ae0af775 Don't run AdditionalOutputFormats e2e test if the feature gate is not
enabled

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:55:50 +00:00
joshvanl
b13e4d4531 Update unit test package for secret manager unit tests, adds user agent
to integration tests

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
7a4be1edfd Copy across an existing secret type in secrets manager since that field
is immutable.

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
a56b6a8596 Fix CA injector test to only create a Secret of type kubernetes.io/tls
since that field is immutable, and shouldn't change from Opaque

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
5660b80888 Gix golang references to feature gate package
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
a9bd3f37dc Use feature gate shared map for determining whether secret template
tests should run

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
81b164289a Fixes spelling in e2e test
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
43c72dd490 Update Certificates SecretTemplate API comments
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
5707fea92e Skip SecretTemplate Certificate controller e2e tests if
ExperimentalSecretApplySecretTemplateControllerMinKubernetesVTODO
feature is not enabled.

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
5004482435 Adds secrettemplate e2e tests
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-17 11:24:45 +00:00
joshvanl
685dd79c0c Makes some minor API naming changes, and clears up some docs around the
Certifcate's additional output formats.

Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
2022-01-14 20:00:26 +00:00
Thierry Sallé
d0094ce277 [e2e] Add more e2e test for additional output formats
Signed-off-by: Thierry Sallé <seuf76@gmail.com>
2022-01-14 11:10:32 +01:00
Thierry Sallé
7f8641dd94 [additionalOutputFormats] Update comments and add more tests
Signed-off-by: Thierry Sallé <seuf76@gmail.com>
2022-01-14 11:10:32 +01:00