Skip to content

Commit

Permalink
Test Bottlerocket nodegroup upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiang-zhang committed Mar 20, 2024
1 parent f85c25c commit ff6f479
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion integration/tests/update/update_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var (

const (
initNG = "kp-ng-0"
botNG = "bot-ng-0"
)

var _ = BeforeSuite(func() {
Expand Down Expand Up @@ -104,6 +105,19 @@ var _ = BeforeSuite(func() {
"--kubeconfig", params.KubeconfigPath,
)
Expect(cmd).To(RunSuccessfully())

cmd = params.EksctlCreateCmd.WithArgs(
"nodegroup",
"--verbose", "4",
"--cluster", defaultCluster,
"--tags", "alpha.eksctl.io/description=eksctl integration test",
"--name", botNG,
"--node-type", "t3.small",
"--nodes", "1",
"--node-ami-family", "Bottlerocket",
"--node-labels", "ng-name="+botNG,
)
Expect(cmd).To(RunSuccessfully())
})
var _ = Describe("(Integration) Upgrading cluster", func() {

Expand Down Expand Up @@ -200,7 +214,7 @@ var _ = Describe("(Integration) Upgrading cluster", func() {
})

Context("nodegroup", func() {
It("should upgrade the nodegroup to the next version", func() {
It("should upgrade the initial nodegroup to the next version", func() {
cmd := params.EksctlUpgradeCmd.WithArgs(
"nodegroup",
"--verbose", "4",
Expand All @@ -219,6 +233,26 @@ var _ = Describe("(Integration) Upgrading cluster", func() {
)
ExpectWithOffset(1, cmd).To(RunSuccessfullyWithOutputString(ContainSubstring(fmt.Sprintf("Version: \"%s\"", nextEKSVersion))))
})

It("should upgrade the Bottlerocket nodegroup to the next version", func() {
cmd := params.EksctlUpgradeCmd.WithArgs(
"nodegroup",
"--verbose", "4",
"--cluster", params.ClusterName,
"--name", botNG,
"--kubernetes-version", nextEKSVersion,
"--timeout=60m", // wait for CF stacks to finish update
)
ExpectWithOffset(1, cmd).To(RunSuccessfullyWithOutputString(ContainSubstring("nodegroup successfully upgraded")))

cmd = params.EksctlGetCmd.WithArgs(
"nodegroup",
"--cluster", params.ClusterName,
"--name", botNG,
"--output", "yaml",
)
ExpectWithOffset(1, cmd).To(RunSuccessfullyWithOutputString(ContainSubstring(fmt.Sprintf("Version: \"%s\"", nextEKSVersion))))
})
})
})

Expand Down

0 comments on commit ff6f479

Please sign in to comment.