Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit c573c7e

Browse files
authored
Merge pull request #871 from mumoshu/fix-release-channel-for-node-pool
Fix node pool release channel
2 parents f22a6f8 + d78b23f commit c573c7e

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

core/nodepool/config/deployment.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ func (c DeploymentSettings) WithDefaultsFrom(main cfg.DeploymentSettings) Deploy
7878

7979
// No defaulting for AvailabilityZone: It must be set explicitly for high availability
8080

81+
// If there was a specific release channel specified for this node pool,
82+
// the user would want to use the latest AMI for the channel, not the latest AMI for the default release channel
83+
// specified in the top level of cluster.yaml
8184
if c.ReleaseChannel == "" {
8285
c.ReleaseChannel = main.ReleaseChannel
83-
}
8486

85-
if c.AmiId == "" {
86-
c.AmiId = main.AmiId
87+
if c.AmiId == "" {
88+
c.AmiId = main.AmiId
89+
}
8790
}
8891

8992
if c.K8sVer == "" {

test/integration/maincluster_test.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,38 @@ worker:
575575
hasDefaultCluster,
576576
},
577577
},
578+
{
579+
context: "WithDifferentReleaseChannels",
580+
configYaml: minimalValidConfigYaml + `
581+
releaseChannel: stable
582+
worker:
583+
nodePools:
584+
- name: pool1
585+
releaseChanel: alpha
586+
`,
587+
assertConfig: []ConfigTester{
588+
hasDefaultEtcdSettings,
589+
asgBasedNodePoolHasWaitSignalEnabled,
590+
},
591+
assertCluster: []ClusterTester{
592+
func(c root.Cluster, t *testing.T) {
593+
cp := c.ControlPlane().StackConfig.AMI
594+
np := c.NodePools()[0].AMI
595+
596+
if cp == "" {
597+
t.Error("the default AMI ID should not be empty but it was")
598+
}
599+
600+
if np == "" {
601+
t.Error("the AMI ID for the node pool should not be empty but it was")
602+
}
603+
604+
if cp != np {
605+
t.Errorf("the default AMI ID and the AMI ID for the node pool didn't match: default=%s, nodepool=%s", cp, np)
606+
}
607+
},
608+
},
609+
},
578610
{
579611
context: "WithElasticFileSystemId",
580612
configYaml: minimalValidConfigYaml + `

0 commit comments

Comments
 (0)