Add computed to node_config.kubelet_config & node_pool_auto_config.node_kubelet_config #19817
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #19792
Support for the
node_config.kubelet_config.insecure_kubelet_readonly_port_enabled
field was added in GoogleCloudPlatform/magic-modules#11573 and was marked Computed.node_config
itself is also Computed, howevernode_config.kubelet_config
is not.This means that:
node_config
is not affectednode_config
but notnode_config.kubelet_config
is affectednode_config.kubelet_config
is not affected.This caused numerous failing tests for us, however, not all the tests we would have expected to fail based on those criteria.
I haven't determined another trigger condition so I suspect it's a partial rollout of a serialisation change.This was confirmed as a rollout in #19792 (comment).kubelet_config
appears in multiple other locations,node_pool_defaults.node_config_defaults.insecure_kubelet_readonly_port_enabled
andnode_pool_auto_config.node_kubelet_config.insecure_kubelet_readonly_port_enabled
node_pool_defaults.node_config_defaults
has the same problem, as it is not Computed whilenode_pool_defaults
andinsecure_kubelet_readonly_port_enabled
are. However, sending justnode_pool_defaults {}
already triggers the same issue with another field (logging_variant
). Ideally we'd makenode_config_defaults
Required, but I'm not sure about the impact on autopilot. I'll file a bug.node_pool_auto_config.node_kubelet_config.insecure_kubelet_readonly_port_enabled
but I've setnode_pool_auto_config.node_kubelet_config
toComputed
anyways since it could exhibit the same issue and I would not want to have to deal with the same problem again. I may cut the change if I can confirm it will never get a default (but I'm not guaranteed / unlikely to find that answer before shipping the change)The update part of the original issue (
Error: googleapi: Error 400: At least one of ['node_version', <snip>, 'max_run_duration'] must be specified.
) is because we usedForceSendFields
with anil
KubeletConfig
value, which does nothing. We had to setKubeletConfig
to&container.KubeletConfig{}
in that block.NullFields
would be correct for a patch in theory, but this is a PUT / customish update and the JSON null still triggers the API error.After this change we can no longer trigger that specific update message. I'll still clean up that callsite / any similarly structured ones to ensure we send an empty struct properly if we do hit them, but in a separate change.
Release Note Template for Downstream PRs (will be copied)
Derived from GoogleCloudPlatform/magic-modules#11971