forked from aws/amazon-vpc-cni-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addon upgrade/downgrade test similar to aws#1795 Added tests for addon upgrade/downgrade Changed DEFAULT version Added addon status checks Fetch latest addon version for given K8s Cluster Update kops cluster config used in weekly tests (aws#1862) * Change to kops cluster creation scripts * Add logging for retry attempt * Switch kops cluster to use docker container runtime Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
524 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package utils | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/aws/services" | ||
"github.com/aws/amazon-vpc-cni-k8s/test/framework/utils" | ||
"github.com/pkg/errors" | ||
"k8s.io/apimachinery/pkg/util/wait" | ||
) | ||
|
||
func WaitTillAddonIsDeleted(eks services.EKS, addonName string, clusterName string) error { | ||
ctx := context.Background() | ||
return wait.PollImmediateUntil(utils.PollIntervalShort, func() (bool, error) { | ||
_, err := eks.DescribeAddon(&services.AddonInput{ | ||
AddonName: addonName, | ||
ClusterName: clusterName, | ||
}) | ||
if err != nil { | ||
return false, err | ||
} | ||
return false, nil | ||
}, ctx.Done()) | ||
} | ||
|
||
func WaitTillAddonIsActive(eks services.EKS, addonName string, clusterName string) error { | ||
ctx := context.Background() | ||
return wait.PollImmediateUntil(utils.PollIntervalShort, func() (bool, error) { | ||
describeAddonOutput, err := eks.DescribeAddon(&services.AddonInput{ | ||
AddonName: addonName, | ||
ClusterName: clusterName, | ||
}) | ||
if err != nil { | ||
return false, err | ||
} | ||
|
||
status := *describeAddonOutput.Addon.Status | ||
if status == "CREATE_FAILED" || status == "DEGRADED" { | ||
return false, errors.Errorf("Create Addon Failed, addon status: %s", status) | ||
} | ||
if status == "ACTIVE" { | ||
return true, nil | ||
} | ||
return false, nil | ||
}, ctx.Done()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.