-
Notifications
You must be signed in to change notification settings - Fork 1k
kubernetes_deployment: changing strategy to Recreate from Rolling breaks the update #585
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
Comments
I have the same issue with provider version 1.9.0 |
Likewise in 1.10.0 and terraform 0.12.12 |
This same issue happens with
Furthermore, Terraform doesn't have the ability to do cross-attribute validation which would be the only mechanism that could detect this condition. Unlikely that we can fix this on the provider side. |
Bug is still there in terraform |
I see this in 0.13.4. Here's a snippet from the plan output where I've changed the strategy from RolllingUpdate to Recreate. I do not specify a rolling_update block and the previous terraform-generated default rolling_update block remains unchanged.
I apply the plan and it fails because you can't have a rolling update params with a Recreate strategy type:
|
This PR has some promising logic that might help in cases like these. https://github.com/hashicorp/terraform-provider-kubernetes/pull/1243/files Specifically, this part of the PR:
If similar logic were applied to the deployment resource, this might solve the problem. |
@dak1n1 was about to post above solution. if the above mentioned PR is accepted ill try to open one for this issue soon with similar logic applied (wasn't sure this was the way to go) |
@DrFaust92 That's great! We definitely appreciate all the work you've been doing on these. I'm trying to get some of them reviewed this week. I like the solution, but I also haven't tested that it works going in the other direction yet (changing from ExternalName to ClusterIP). That's the only part I wanted to double-check. |
@dak1n1 I added a test for the other direction and seems fine. 😁 |
Opened #1255, managed to to make it work in both directions. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Updated to
Expected Behavior
Expect it to recreate the deployment or unset the rolling_update defaults on the strategy
Actual Behavior
If it was not set or set to RollingUpdates then the rolling_update defaults stay behind and gives an spec.strategy.rollingUpdate: Forbidden: may not be specified when strategy
type
is 'Recreate'Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
Important Factoids
I imagine the easy fix is to force new for the resource, but the better fix is to unsetting rolling_update when type is set to Recreate.
The text was updated successfully, but these errors were encountered: