From 99bef3022ac007468497fad6f606f6f34c8e81a0 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Tue, 16 Dec 2025 14:38:50 -0600 Subject: [PATCH] feat(aws): enable shared role in e2e This commit enables the use of a shared role on AWS for all test clusters except TestUpgradeControlPlane, which continues to verify the use individual roles. This test cluster was also choosen to avoid having to do complex filtering for z-stream releases that do not contain the required HCCO fix. --- test/e2e/control_plane_upgrade_test.go | 5 +++++ test/e2e/util/options.go | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/test/e2e/control_plane_upgrade_test.go b/test/e2e/control_plane_upgrade_test.go index 02fbb93778b7..a3f1c6bb7c63 100644 --- a/test/e2e/control_plane_upgrade_test.go +++ b/test/e2e/control_plane_upgrade_test.go @@ -28,6 +28,11 @@ func TestUpgradeControlPlane(t *testing.T) { clusterOpts.ReleaseImage = globalOpts.PreviousReleaseImage clusterOpts.ControlPlaneAvailabilityPolicy = string(hyperv1.HighlyAvailable) + if globalOpts.Platform == hyperv1.AWSPlatform { + // Use this test to verify that individual roles work as expected + clusterOpts.AWSPlatform.SharedRole = false + } + 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 guestClient := e2eutil.WaitForGuestClient(t, ctx, mgtClient, hostedCluster) diff --git a/test/e2e/util/options.go b/test/e2e/util/options.go index d434cd01d6b4..ccee4654ef28 100644 --- a/test/e2e/util/options.go +++ b/test/e2e/util/options.go @@ -284,11 +284,19 @@ func (o *Options) DefaultAWSOptions() hypershiftaws.RawCreateOptions { MultiArch: o.ConfigurableClusterOptions.AWSMultiArch, PublicOnly: true, UseROSAManagedPolicies: true, + SharedRole: true, } + if IsLessThan(semver.MustParse("4.16.0")) { opts.PublicOnly = false } + // HCCO requires this fix https://github.com/openshift/hypershift/pull/7383 + // in order for shared roles to work properly. + if IsLessThan(semver.MustParse("4.20.0")) { + opts.SharedRole = false + } + // Set an expiration date tag if it's not already set expirationDateTagSet := false for _, tag := range o.AdditionalTags {