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

Fix restart_policy validation in Deployment #2595

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

alexsomesan
Copy link
Member

@alexsomesan alexsomesan commented Sep 30, 2024

Description

Fixes validation of restart_policy values in Deployment's pod template - only "Always" is a valid value in this case

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:

$ make testacc TESTARGS='-run=^TestAccKubernetesDeploymentV1_with_restart_policy'
=== RUN   TestAccKubernetesDeploymentV1_with_restart_policy
=== PAUSE TestAccKubernetesDeploymentV1_with_restart_policy
=== CONT  TestAccKubernetesDeploymentV1_with_restart_policy
--- PASS: TestAccKubernetesDeploymentV1_with_restart_policy (12.22s)
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   13.430s

Release Note

Release note for CHANGELOG:

resource/kubernetes_deployment_v1: Fix validation of `restart_policy` values

References

Fixes #2591

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

@alexsomesan alexsomesan added the no-documentation This issue or pull request does not have documentation changes. label Oct 1, 2024
@alexsomesan alexsomesan marked this pull request as ready for review October 1, 2024 17:25
@alexsomesan alexsomesan requested a review from a team as a code owner October 1, 2024 17:25
@alexsomesan alexsomesan force-pushed the fix-deployment-restart-policy branch from f6e3b0c to 89bb69e Compare October 1, 2024 17:25
@alexsomesan alexsomesan force-pushed the fix-deployment-restart-policy branch from 89bb69e to aa5d3b2 Compare October 17, 2024 10:11
Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

After reading through the original issue the code changes in this PR make sense, and I can see the new acc test passed.

Are there plans to make the field accept the other 2 values in the future? Or is making the pods always restart a way to ensure we're keeping everything declarative and predictable?

Also, I saw some unrelated acceptance tests failed- could you confirm that they're unrelated before merging?

@alexsomesan alexsomesan merged commit 01f6171 into main Oct 17, 2024
24 checks passed
@alexsomesan alexsomesan deleted the fix-deployment-restart-policy branch October 17, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-documentation This issue or pull request does not have documentation changes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"restart_policy" is wrongly documented at least for kubernetes_deployment resource
2 participants