Skip to content

Commit

Permalink
Wait for new server version in integration test (eksctl-io#2644)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeaumont authored Sep 14, 2020
1 parent 0a33b61 commit 2721725
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions integration/tests/managed/managed_nodegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import (
"k8s.io/client-go/tools/clientcmd"
)

const (
k8sUpdatePollInterval = "2s"
k8sUpdatePollTimeout = "3m"
)

var params *tests.Params

func init() {
Expand Down Expand Up @@ -246,10 +251,11 @@ var _ = Describe("(Integration) Create Managed Nodegroups", func() {

clientset, err := kubernetes.NewForConfig(config)
Expect(err).ToNot(HaveOccurred())

serverVersion, err := clientset.ServerVersion()
Expect(err).ToNot(HaveOccurred())
Expect(fmt.Sprintf("%s.%s", serverVersion.Major, strings.TrimSuffix(serverVersion.Minor, "+"))).To(Equal(nextVersion))
Eventually(func() string {
serverVersion, err := clientset.ServerVersion()
Expect(err).ToNot(HaveOccurred())
return fmt.Sprintf("%s.%s", serverVersion.Major, strings.TrimSuffix(serverVersion.Minor, "+"))
}, k8sUpdatePollTimeout, k8sUpdatePollInterval).Should(Equal(nextVersion))

By(fmt.Sprintf("upgrading nodegroup %s to Kubernetes version %s", initialNodeGroup, nextVersion))
cmd = params.EksctlUpgradeCmd.WithArgs(
Expand Down

0 comments on commit 2721725

Please sign in to comment.