Skip to content

Commit

Permalink
fix: NodePool should not late-init node count
Browse files Browse the repository at this point in the history
The nodepool's node_count and initial_node_count should not be
late-initialized to prevent a fight with the GKE autoscaler.

Signed-off-by: Moritz Johner <[email protected]>
  • Loading branch information
moolen committed Jan 26, 2024
1 parent c4a0101 commit 6819b2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/container/v1beta1/zz_generated_terraformed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/container/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ func Configure(p *config.Provider) { //nolint:gocyclo
Type: "Cluster",
Extractor: common.ExtractResourceIDFuncPath,
}
r.LateInitializer = config.LateInitializer{
IgnoredFields: []string{
"node_count",
"initial_node_count",
},
}

r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) {
if diff == nil || diff.Destroy {
Expand Down

0 comments on commit 6819b2b

Please sign in to comment.