Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/aws-e2e-tests-non-root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
GHA_ASSUME_ROLE: arn:aws:iam::307493967395:role/tf-aws-e2e-gha-role
KUBERNETES_SERVICE_ASSUME_ROLE: arn:aws:iam::307493967395:role/tf-eks-discovery-ci-cluster-kubernetes-service-access-role
DISCOVERY_SERVICE_ASSUME_ROLE: arn:aws:iam::307493967395:role/tf-eks-discovery-ci-cluster-discovery-service-access-role
DISCOVERED_CLUSTER_NAME: gha-discovery-ci
DISCOVERED_CLUSTER_NAME: gha-discovery-ci-eks-us-west-2-307493967395
jobs:
test:
name: AWS E2E Tests (Non-root)
Expand Down
10 changes: 9 additions & 1 deletion e2e/aws/eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -90,7 +91,14 @@ func awsEKSDiscoveryMatchedCluster(t *testing.T) {
defer cancel()

clusters, err := authC.GetKubernetesClusters(ctx)
return err == nil && len(clusters) == 1 && clusters[0].GetName() == os.Getenv(discoveredClusterNameEnv)
if err != nil || len(clusters) == 0 {
return false
}
// Fail fast if the discovery service creates more than one cluster.
assert.Equal(t, 1, len(clusters))
// Fail fast if the discovery service creates a cluster with a different name.
assert.Equal(t, os.Getenv(discoveredClusterNameEnv), clusters[0].GetName())
return true
Comment thread
tigrato marked this conversation as resolved.
Outdated
}, 3*time.Minute, 10*time.Second, "wait for the discovery service to create a cluster")

// Wait for the kubernetes service to create a KubernetesServer resource.
Expand Down