Skip to content

Commit

Permalink
Enable EnsureCustomLabels e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
muraee committed Jan 31, 2025
1 parent e4b8dc5 commit b467a84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions test/e2e/create_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,10 @@ func TestCreateCluster(t *testing.T) {
}
if !e2eutil.IsLessThan(e2eutil.Version418) {
clusterOpts.FeatureSet = string(configv1.TechPreviewNoUpgrade)
clusterOpts.PodsLabels = map[string]string{
"hypershift-e2e-test-label": "test",
}
}

clusterOpts.PodsLabels = map[string]string{
"hypershift-e2e-test-label": "test",
}

e2eutil.NewHypershiftTest(t, ctx, func(t *testing.T, g Gomega, mgtClient crclient.Client, hostedCluster *hyperv1.HostedCluster) {
Expand Down Expand Up @@ -1138,14 +1139,15 @@ func TestCreateCluster(t *testing.T) {

integration.RunTestControlPlanePKIOperatorBreakGlassCredentials(t, testContext, hostedCluster, mgmtClients, guestClients)
e2eutil.EnsureAPIUX(t, ctx, mgtClient, hostedCluster)
// TODO: enable when CNO/CSI changes to add the Labels to their 2nd-level operands is added.
// e2eutil.EnsureCustomLabels(t, ctx, mgtClient, hostedCluster)
e2eutil.EnsureCustomLabels(t, ctx, mgtClient, hostedCluster)
}).
Execute(&clusterOpts, globalOpts.Platform, globalOpts.ArtifactDir, globalOpts.ServiceAccountSigningKey)
}

// TestCreateClusterV2 tests the new CPO implementation, which is currently hidden behind an annotation.
func TestCreateClusterV2(t *testing.T) {
e2eutil.AtLeast(t, e2eutil.Version419)

t.Parallel()

ctx, cancel := context.WithCancel(testContext)
Expand All @@ -1170,6 +1172,11 @@ func TestCreateClusterV2(t *testing.T) {
}
}

clusterOpts.FeatureSet = string(configv1.TechPreviewNoUpgrade)
clusterOpts.PodsLabels = map[string]string{
"hypershift-e2e-test-label": "test",
}

e2eutil.NewHypershiftTest(t, ctx, func(t *testing.T, g Gomega, mgtClient crclient.Client, hostedCluster *hyperv1.HostedCluster) {
// Sanity check the cluster by waiting for the nodes to report ready
_ = e2eutil.WaitForGuestClient(t, ctx, mgtClient, hostedCluster)
Expand All @@ -1195,6 +1202,7 @@ func TestCreateClusterV2(t *testing.T) {

integration.RunTestControlPlanePKIOperatorBreakGlassCredentials(t, testContext, hostedCluster, mgmtClients, guestClients)
e2eutil.EnsureAPIUX(t, ctx, mgtClient, hostedCluster)
e2eutil.EnsureCustomLabels(t, ctx, mgtClient, hostedCluster)
}).Execute(&clusterOpts, globalOpts.Platform, globalOpts.ArtifactDir, globalOpts.ServiceAccountSigningKey)
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,7 @@ func EnsurePayloadArchSetCorrectly(t *testing.T, ctx context.Context, client crc

func EnsureCustomLabels(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
t.Run("EnsureCustomLabels", func(t *testing.T) {
AtLeast(t, Version418)
AtLeast(t, Version419)

hcpNamespace := manifests.HostedControlPlaneNamespace(hostedCluster.Namespace, hostedCluster.Name)
podList := &corev1.PodList{}
Expand Down

0 comments on commit b467a84

Please sign in to comment.