@@ -2604,9 +2604,6 @@ func TestContainerLoggingMinLength(t *testing.T) {
26042604}
26052605
26062606func TestIngressControllerCustomEndpoints (t * testing.T ) {
2607- if infraConfig .Status .ControlPlaneTopology == configv1 .ExternalTopologyMode {
2608- t .Skipf ("skipping TestIngressControllerCustomEndpoints test due to controlplanetopology: %v" , infraConfig .Status .ControlPlaneTopology )
2609- }
26102607 platform := infraConfig .Status .PlatformStatus
26112608 if platform == nil {
26122609 t .Fatalf ("platform status is missing for infrastructure %s" , infraConfig .Name )
@@ -2646,13 +2643,20 @@ func TestIngressControllerCustomEndpoints(t *testing.T) {
26462643 URL : fmt .Sprintf ("https://elasticloadbalancing.%s.amazonaws.com" , platform .AWS .Region ),
26472644 }
26482645
2649- oldCCMDeployment := waitForCCMReadiness (t , 5 * time .Minute , "" )
2650- oldConfigHash := retrieveCCMConfigurationHash (oldCCMDeployment )
2651- if oldConfigHash == "" {
2652- t .Fatalf ("CCM does not have a config hash, this should never happen: %v" , oldCCMDeployment )
2646+ // On a non-managed environment, retrieve the current Cloud Controller Manager
2647+ // configuration hash, so later we can verify if the new configuration was applied
2648+ // as part of the infrastructure.config update
2649+ var oldConfigHash string
2650+ if infraConfig .Status .ControlPlaneTopology != configv1 .ExternalTopologyMode {
2651+ oldCCMDeployment := waitForCCMAvailableAndUpdated (t , 5 * time .Minute , "" )
2652+ oldConfigHash = retrieveCCMConfigurationHash (oldCCMDeployment )
2653+ if oldConfigHash == "" {
2654+ t .Fatalf ("CCM does not have a config hash, this should never happen: %v" , oldCCMDeployment )
2655+ }
26532656 }
26542657
2655- if err := updateInfrastructureConfigWithRetryOnConflict (t , types.NamespacedName {Name : "cluster" }, timeout , func (spec * configv1.InfrastructureSpec ) {
2658+ // Wait for infrastructure status to update with custom endpoints.
2659+ if err := updateAndVerifyInfrastructureConfigWithRetry (t , types.NamespacedName {Name : "cluster" }, timeout , func (spec * configv1.InfrastructureSpec ) {
26562660 spec .PlatformSpec .AWS = & configv1.AWSPlatformSpec {
26572661 ServiceEndpoints : []configv1.AWSServiceEndpoint {
26582662 route53Endpoint ,
@@ -2665,22 +2669,19 @@ func TestIngressControllerCustomEndpoints(t *testing.T) {
26652669 }
26662670 defer func () {
26672671 // Remove the custom endpoints from the infrastructure config.
2668- if err := updateInfrastructureConfigWithRetryOnConflict (t , types.NamespacedName {Name : "cluster" }, timeout , func (spec * configv1.InfrastructureSpec ) {
2672+ if err := updateAndVerifyInfrastructureConfigWithRetry (t , types.NamespacedName {Name : "cluster" }, timeout , func (spec * configv1.InfrastructureSpec ) {
26692673 spec .PlatformSpec .AWS = nil
26702674 }); err != nil {
26712675 t .Fatalf ("failed to update infrastructure config: %v" , err )
26722676 }
26732677 }()
26742678
2675- // Wait for infrastructure status to update with custom endpoints,
2676- // for CCM deploy to get a new configuration hash and for pods to be scheduled
2677- // and available
2678- // This configuration change and replicas available may take up to 5 minutes, depending on
2679- // the environment load
2680-
2681- // Wait for CCM to be ready with the new configuration, so we can guarantee that
2682- // the LoadBalancer will be created correctly
2683- _ = waitForCCMReadiness (t , 5 * time .Minute , oldConfigHash )
2679+ if infraConfig .Status .ControlPlaneTopology != configv1 .ExternalTopologyMode {
2680+ // Wait for CCM to be ready with the new configuration, so we can guarantee that
2681+ // the LoadBalancer will be created correctly. This assertion is not possible
2682+ // on managed control planes (eg.: hypershift or rosa)
2683+ _ = waitForCCMAvailableAndUpdated (t , 5 * time .Minute , oldConfigHash )
2684+ }
26842685
26852686 // The default ingresscontroller should surface the expected status conditions.
26862687 if err := waitForIngressControllerCondition (t , kclient , 30 * time .Second , defaultName , availableConditionsForIngressControllerWithLoadBalancer ... ); err != nil {
0 commit comments