Skip to content

Commit

Permalink
Handling Errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
orsenthil committed Nov 19, 2023
1 parent 1e5a858 commit b3a418b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
13 changes: 7 additions & 6 deletions test/framework/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ type Options struct {
}

func (options *Options) BindFlags() {
flag.StringVar(&options.KubeConfig, "cluster-kubeconfig", "", "Path to kubeconfig containing embedded authinfo (required)")
flag.StringVar(&options.ClusterName, "cluster-name", "", `Kubernetes cluster name (required)`)
flag.StringVar(&options.AWSRegion, "aws-region", "", `AWS Region for the kubernetes cluster`)
flag.StringVar(&options.AWSVPCID, "aws-vpc-id", "", `AWS VPC ID for the kubernetes cluster`)
flag.StringVar(&options.NgNameLabelKey, "ng-name-label-key", "eks.amazonaws.com/nodegroup", "label key used to identify nodegroup name")
flag.StringVar(&options.NgNameLabelVal, "ng-name-label-val", "", "label value with the nodegroup name")
flag.StringVar(&options.KubeConfig, "cluster-kubeconfig", "/Users/senthilx/.kube/config", "Path to kubeconfig containing embedded authinfo (required)")
flag.StringVar(&options.ClusterName, "cluster-name", "networking-prow-1-28-1660-510756222", `Kubernetes cluster name (required)`)
flag.StringVar(&options.AWSRegion, "aws-region", "us-west-2", `AWS Region for the kubernetes cluster`)
flag.StringVar(&options.AWSVPCID, "aws-vpc-id", "vpc-09c1a9bf4aaf6880e", `AWS VPC ID for the kubernetes cluster`)
flag.StringVar(&options.NgNameLabelKey, "ng-name-label-key", "kubernetes.io/os", "label key used to identify nodegroup name")
flag.StringVar(&options.NgNameLabelVal, "ng-name-label-val", "linux", "label value with the nodegroup name")
flag.StringVar(&options.EKSEndpoint, "eks-endpoint", "", "optional eks api server endpoint")
flag.StringVar(&options.InitialAddon, "initial-addon-version", "", "Initial CNI addon version before upgrade applied")
flag.StringVar(&options.TargetAddon, "target-addon-version", "", "Target CNI addon version after upgrade applied")
Expand All @@ -71,6 +71,7 @@ func (options *Options) BindFlags() {
flag.StringVar(&options.AvailabilityZones, "availability-zones", "", "Comma separated list of private subnets (optional, if specified you must specify all of public/private-subnets, public-route-table-id, and availability-zones)")
flag.StringVar(&options.PublicRouteTableID, "public-route-table-id", "", "Public route table ID (optional, if specified you must specify all of public/private-subnets, public-route-table-id, and availability-zones)")
flag.StringVar(&options.NgK8SVersion, "ng-kubernetes-version", "1.25", `Kubernetes version for self-managed node groups (optional, default is "1.25")`)
// 617930562442 is an internal ECR registry serving test containers.
flag.StringVar(&options.TestImageRegistry, "test-image-registry", "617930562442.dkr.ecr.us-west-2.amazonaws.com", `AWS registry where the e2e test images are stored`)
}

Expand Down
14 changes: 12 additions & 2 deletions test/integration/cni/pod_networking_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ var _ = BeforeSuite(func() {
f = framework.New(framework.GlobalOptions)

By("creating test namespace")
f.K8sResourceManagers.NamespaceManager().CreateNamespace(utils.DefaultTestNamespace)
err := f.K8sResourceManagers.NamespaceManager().CreateNamespace(utils.DefaultTestNamespace)

if err != nil {
return
}

By(fmt.Sprintf("getting the node with the node label key %s and value %s",
f.Options.NgNameLabelKey, f.Options.NgNameLabelVal))
Expand Down Expand Up @@ -110,9 +114,14 @@ var _ = BeforeSuite(func() {

var _ = AfterSuite(func() {
By("deleting test namespace")
f.K8sResourceManagers.NamespaceManager().

err := f.K8sResourceManagers.NamespaceManager().
DeleteAndWaitTillNamespaceDeleted(utils.DefaultTestNamespace)

if err != nil {
return
}

k8sUtils.UpdateEnvVarOnDaemonSetAndWaitUntilReady(f, "aws-node", "kube-system",
"aws-node", map[string]string{
"AWS_VPC_ENI_MTU": DEFAULT_MTU_VAL,
Expand All @@ -123,4 +132,5 @@ var _ = AfterSuite(func() {
"WARM_ENI_TARGET": {},
"IP_COOLDOWN_PERIOD": {},
})

})

0 comments on commit b3a418b

Please sign in to comment.