-
Notifications
You must be signed in to change notification settings - Fork 986
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
Unable to remove certain blocks from Terraform config #961
Comments
Another instance of this issue came up today with the |
Related: unable to remove limits{} block. #754 |
The empty PodSpec blocks now report an error instead of crashing:
There is still the issue of being unable to remove blocks from a config once an object has been created. We would have to modify each resource's Update function to be able to handle removalsof attributes during in-place updates. Offhand I'm not sure if any crashes remain. |
If we had the ability to remove attributes on Update, we could also fix this issue #585 |
Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you! |
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. |
Description
When specifying a Terraform config, we can add certain blocks to the resource, such as adding this block to the cluster_role resource:
However, once we add the block, it cannot be removed in-place using Terraform. The user will either have to delete the block using
kubectl
or destroy and re-create the resource. If they attempt to apply an empty block (blockname{}
), or remove the block entirely from their config, Terraform may either crash or return a Kubernetes API error.Terraform Version and Provider Version
Terraform v0.12.28
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/dak1n1/f7dc3231af106c432876a4139231da75
Expected Behavior
When a block is removed from the Terraform config, it should be removed from the remote resource.
Actual Behavior
Users have to manually delete objects (or parts of objects) when removing a config block. Otherwise, a Kubernetes API error (like the one below) is returned. Or, depending on the resource, Terraform may crash.
Steps to Reproduce
aggregated_rules
block and apply again. The update should be successful.aggregated_rules
block. Updates will now return Kubernetes API errors.Important Factoids
This is somewhat of a generic problem affecting multiple resources.
References
Config blocks (such as
env_from{}
) will crash Terraform when empty, unless we check fornil
. Example check here.Community Note
The text was updated successfully, but these errors were encountered: