hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider
https://www.terraform.io/docs/providers/kubernetes/
Mozilla Public License 2.0
1.6k stars 979 forks source link

run acceptance tests with multiple versions of kubernetes #2563

Closed coryflucas closed 3 months ago

coryflucas commented 3 months ago

Description

Leverage a matrix to run the acceptance tests against multiple versions of Kubernetes.

The versions are based on the default version previously used (1.27) and the versions used in the manifest acceptance tests but with corrected SHAs to match the version of kind in use. Note: there is no 1.30 image available for kind 0.20 (its available for 0.23) so I opted to use 1.29.

Acceptance tests

N/A

Release Note

Release note for CHANGELOG:

NONE

References

fixes #2562

Community Note

BBBmau commented 3 months ago

can you provide a link to your workflow of your changes to confirm? We should be able to see the matrix of the k8s versions all passing.

coryflucas commented 3 months ago

I had originally thought the workflow had already run in my branch but it hadn't due to the workflow being restricted to only run against the Hashicorp org. I got it running and have found that a subset of the tests fail against older versions of Kubernetes. The failures seem to fall into 3 categories:

  1. They are covering features that aren't supported in those k8s versions.
  2. They are testing things that are both supported and some that are not supported in those k8s versions, so really just the tests need refactoring.
  3. The provider has unexpected behavior with older versions k8s. The number of issues in this category looks to be pretty small (it looks like 3 right now) and they are relatively minor (mostly they result in an apply followed by a plan still showing changes).

I'd like to propose the following to get the tests in a passing state:

Let me know what you think about this approach and I'll follow up.

coryflucas commented 3 months ago

@BBBmau I wen't ahead and did my proposed change in a new branch and have all tests now passing. Here is a break down of the issues I found:

Here is a link to the workflow run with the changes + a change to enable the workflow in my fork. Please let me know if you'd like me to merge those changes into this branch or go with a different approach.

BBBmau commented 3 months ago

@coryflucas thanks for working on this! I haven't had the change to really look at your PR in depth. I plan on doing this next week just as a heads-up. Apologies for the delay!