fix(eks): store and return node group launchTemplate, taints, remoteAccess, nodeRepairConfig and warmPoolConfig (#4102)

CreateNodeGroupRequest modelled 14 of the 19 documented CreateNodegroup body
members. The other five were discarded by @JsonIgnoreProperties during
deserialization, so DescribeNodegroup omitted them and OpenTofu saw a node group
with no launch template where one was declared. Adding a launch template to a
node group that lacks one is ForceNew in the AWS provider schema, so every plan
destroyed and recreated the node group.

The five are added to the request as Object and copied onto the stored node
group, matching the generic JSON passthrough convention Nodegroup already
records for recursive sub-structures. warmPoolConfig was also missing from
Nodegroup itself and is added there too.

They are recorded as metadata only. Launch template user data is not executed.
This commit is contained in:
Simone Primarosa authored and GitHub committed 2026-09-21 16:07:01 -04:00
1 parent 31a19df6f5
commit cebdc6f2bb
6 files changed
+389 -2

No files matched your search

@@ -596,6 +596,11 @@ public class EksService implements TagHandler, ResourceProvider {
nodegroup.setInstanceTypes(request.getInstanceTypes());
nodegroup.setScalingConfig(request.getScalingConfig());
nodegroup.setUpdateConfig(request.getUpdateConfig());
nodegroup.setRemoteAccess(request.getRemoteAccess());
nodegroup.setTaints(request.getTaints());
nodegroup.setLaunchTemplate(request.getLaunchTemplate());
nodegroup.setNodeRepairConfig(request.getNodeRepairConfig());
nodegroup.setWarmPoolConfig(request.getWarmPoolConfig());
nodegroup.setLabels(request.getLabels());
nodegroup.setTags(request.getTags());
nodegroup.setClientRequestToken(request.getClientRequestToken());
@@ -651,6 +656,13 @@ public class EksService implements TagHandler, ResourceProvider {
nodeGroup.setResources(defaultNodeGroupResources(nodegroupName));
nodeGroup.setHealth(defaultNodeGroupHealth());
nodeGroup.setUpdateConfig(request.getUpdateConfig() != null ? request.getUpdateConfig() : defaultUpdateConfig());
// Echoed back verbatim, and left unset when absent: EKS omits these rather than returning
// an explicit null, and a null is drift to a caller diffing against its declared config.
nodeGroup.setRemoteAccess(request.getRemoteAccess());
nodeGroup.setTaints(request.getTaints());
nodeGroup.setLaunchTemplate(request.getLaunchTemplate());
nodeGroup.setNodeRepairConfig(request.getNodeRepairConfig());
nodeGroup.setWarmPoolConfig(request.getWarmPoolConfig());
nodeGroup.setLabels(request.getLabels() != null ? new HashMap<>(request.getLabels()) : null);
nodeGroup.setTags(request.getTags() != null ? new HashMap<>(request.getTags()) : new HashMap<>());
@@ -7,6 +7,12 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
/**
* {@code CreateNodegroup} request body. {@code clusterName} is absent because it travels in the
* URI path. Recursive sub-structures (remoteAccess, taints, launchTemplate, updateConfig,
* nodeRepairConfig, warmPoolConfig) round-trip as generic JSON, matching the convention
* {@link Nodegroup} records: the management plane only echoes them back.
*/
@RegisterForReflection
@JsonIgnoreProperties(ignoreUnknown = true)
public class CreateNodeGroupRequest {
@@ -44,6 +50,21 @@ public class CreateNodeGroupRequest {
@JsonProperty("updateConfig")
private Object updateConfig;
@JsonProperty("remoteAccess")
private Object remoteAccess;
@JsonProperty("taints")
private List<Object> taints;
@JsonProperty("launchTemplate")
private Object launchTemplate;
@JsonProperty("nodeRepairConfig")
private Object nodeRepairConfig;
@JsonProperty("warmPoolConfig")
private Object warmPoolConfig;
@JsonProperty("labels")
private Map<String, String> labels;
@@ -88,6 +109,21 @@ public class CreateNodeGroupRequest {
public Object getUpdateConfig() { return updateConfig; }
public void setUpdateConfig(Object updateConfig) { this.updateConfig = updateConfig; }
public Object getRemoteAccess() { return remoteAccess; }
public void setRemoteAccess(Object remoteAccess) { this.remoteAccess = remoteAccess; }
public List<Object> getTaints() { return taints; }
public void setTaints(List<Object> taints) { this.taints = taints; }
public Object getLaunchTemplate() { return launchTemplate; }
public void setLaunchTemplate(Object launchTemplate) { this.launchTemplate = launchTemplate; }
public Object getNodeRepairConfig() { return nodeRepairConfig; }
public void setNodeRepairConfig(Object nodeRepairConfig) { this.nodeRepairConfig = nodeRepairConfig; }
public Object getWarmPoolConfig() { return warmPoolConfig; }
public void setWarmPoolConfig(Object warmPoolConfig) { this.warmPoolConfig = warmPoolConfig; }
public Map<String, String> getLabels() { return labels; }
public void setLabels(Map<String, String> labels) { this.labels = labels; }
@@ -14,8 +14,9 @@ import java.util.Map;
/**
* EKS managed node group. Doubles as the {@code CreateNodegroup} request body (the input
* members are a subset) and the wire response. Recursive sub-structures
* (remoteAccess, taints, launchTemplate, updateConfig, nodeRepairConfig, resources, health)
* round-trip as generic JSON so we don't over-model what the management plane just echoes.
* (remoteAccess, taints, launchTemplate, updateConfig, nodeRepairConfig, warmPoolConfig,
* resources, health) round-trip as generic JSON so we don't over-model what the management
* plane just echoes.
*/
@RegisterForReflection
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -93,6 +94,9 @@ public class Nodegroup {
@JsonProperty("launchTemplate")
private Object launchTemplate;
@JsonProperty("warmPoolConfig")
private Object warmPoolConfig;
@JsonProperty("tags")
private Map<String, String> tags;
@@ -174,6 +178,9 @@ public class Nodegroup {
public Object getLaunchTemplate() { return launchTemplate; }
public void setLaunchTemplate(Object launchTemplate) { this.launchTemplate = launchTemplate; }
public Object getWarmPoolConfig() { return warmPoolConfig; }
public void setWarmPoolConfig(Object warmPoolConfig) { this.warmPoolConfig = warmPoolConfig; }
public Map<String, String> getTags() { return tags; }
public void setTags(Map<String, String> tags) { this.tags = tags; }