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
- Loading branch information
Chinmay Gadgil
committed
Feb 14, 2022
1 parent
0007251
commit 8036196
Showing
8 changed files
with
518 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,52 @@ | ||
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" | ||
"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, | ||
}) | ||
status := *describeAddonOutput.Addon.Status | ||
if status == "ACTIVE" { | ||
return true, nil | ||
} | ||
if err != nil { | ||
return false, err | ||
} | ||
return false, nil | ||
}, ctx.Done()) | ||
} | ||
|
||
func GetCurrentAddonVersion(eks services.EKS, addonName string, clusterName string) string { | ||
describeAddonOutput, err := eks.DescribeAddon(&services.AddonInput{ | ||
AddonName: addonName, | ||
ClusterName: clusterName, | ||
}) | ||
if err == nil { | ||
return *describeAddonOutput.Addon.AddonVersion | ||
} | ||
return "" | ||
} |
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.