Skip to content

Send empty GKE objects explicitly #8400

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/11978.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
container: `node_config.linux_config`, `node_config.workload_metadata_config` and `node_config.kubelet_config` will now successfully send empty messages to the API when `terraform plan` indicates they are being removed, rather than null, which caused an error. The sole reliable case is `node_config.linux_config` when the block is removed, where there will still be a permadiff, but the update request that's triggered will no longer error and other changes displayed in the plan should go through.
```
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,7 @@ func nodePoolUpdate(d *schema.ResourceData, meta interface{}, nodePoolInfo *Node
d.Get(prefix + "node_config.0.workload_metadata_config")),
}
if req.WorkloadMetadataConfig == nil {
req.WorkloadMetadataConfig = &container.WorkloadMetadataConfig{}
req.ForceSendFields = []string{"WorkloadMetadataConfig"}
}
updateF := func() error {
Expand Down Expand Up @@ -1822,6 +1823,7 @@ func nodePoolUpdate(d *schema.ResourceData, meta interface{}, nodePoolInfo *Node
d.Get(prefix + "node_config.0.kubelet_config")),
}
if req.KubeletConfig == nil {
req.KubeletConfig = &container.NodeKubeletConfig{}
req.ForceSendFields = []string{"KubeletConfig"}
}
updateF := func() error {
Expand Down Expand Up @@ -1855,6 +1857,7 @@ func nodePoolUpdate(d *schema.ResourceData, meta interface{}, nodePoolInfo *Node
d.Get(prefix + "node_config.0.linux_node_config")),
}
if req.LinuxNodeConfig == nil {
req.LinuxNodeConfig = &container.LinuxNodeConfig{}
req.ForceSendFields = []string{"LinuxNodeConfig"}
}
updateF := func() error {
Expand Down