Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for storage/v1 #1457

Merged
merged 3 commits into from Nov 2, 2021
Merged

Add support for storage/v1 #1457

merged 3 commits into from Nov 2, 2021

Conversation

jrhouston
Copy link
Contributor

@jrhouston jrhouston commented Oct 13, 2021

Description

This PR adds support for storage/v1 – the only resource affected by this change is kubernetes_csi_driver. This change adds a kubernetes_csi_driver_v1 and adds a deprecation warning to kubernetes_csi_driver. There are no fields added or removed in v1 so the schema remains the same.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

v1.22

=== RUN   TestAccKubernetesCSIDriver_basic
    provider_test.go:233: This test does not run on cluster versions 1.22.0 and above
--- SKIP: TestAccKubernetesCSIDriver_basic (0.07s)
=== RUN   TestAccKubernetesCSIDriverV1_basic
--- PASS: TestAccKubernetesCSIDriverV1_basic (13.87s)
PASS
ok  	github.com/hashicorp/terraform-provider-kubernetes/kubernetes	17.539s

v1.21

=== RUN   TestAccKubernetesCSIDriver_basic
--- PASS: TestAccKubernetesCSIDriver_basic (10.57s)
=== RUN   TestAccKubernetesCSIDriverV1_basic
    provider_test.go:227: This test does not run on cluster versions below 1.22.0
--- SKIP: TestAccKubernetesCSIDriverV1_basic (0.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-kubernetes/kubernetes	13.617s

Release Note

Release note for CHANGELOG:

Add kubernetes_csi_driver_v1 resource to support storage/v1

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@@ -169,54 +169,81 @@ func Provider() *schema.Provider {
},

DataSourcesMap: map[string]*schema.Resource{
"kubernetes_all_namespaces": dataSourceKubernetesAllNamespaces(),
Copy link
Contributor Author

@jrhouston jrhouston Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've sorted this mapping into groups in advance of a more thorough re-organization of the code I have planned here.

PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() {
testAccPreCheck(t)
skipIfClusterVersionGreaterThan(t, "v1.21.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skip was actually broken and always returning false as it needs to happen after the provider is initialized by testAccPreCheck().

@@ -0,0 +1,212 @@
package kubernetes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much all the code below except for the deprecation warning is a straight copy of the existing resource, but with the API function changed from V1Beta1 to V1

Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tested, it works nicely.
One tiny spelling omission in the deprecation message.

kubernetes/resource_kubernetes_csi_driver.go Outdated Show resolved Hide resolved
Co-authored-by: Alex Somesan <alex.somesan@gmail.com>
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants