Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

fix(core): Always use clusters parameter for ECS server group URLs (backport #10171)#10175

Merged
edgarulg merged 1 commit intorelease-1.36.xfrom
mergify/bp/release-1.36.x/pr-10171
Apr 21, 2025
Merged

fix(core): Always use clusters parameter for ECS server group URLs (backport #10171)#10175
edgarulg merged 1 commit intorelease-1.36.xfrom
mergify/bp/release-1.36.x/pr-10171

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Apr 21, 2025

Fix ECS Server Group URLs When onDemandClusterThreshold is Exceeded

Problem

When viewing ECS server groups in Spinnaker and the onDemandClusterThreshold is exceeded, the generated URLs fail to navigate to the correct server group. This happens because:

  1. ECS provider requires using the clusters parameter for server group navigation
  2. The current implementation uses the standard q, acct, and reg parameters which don't work properly for ECS when on-demand caching is disabled

This results in broken links for ECS server groups in the UI when the number of caches exceeds the threshold.

Solution

This PR modifies the ServerGroupsUrlBuilder.build method to use a different URL format specifically for ECS server groups:

// For ECS provider, use clusters parameter format
if (input.provider === 'ecs' || (input.provider && input.provider.includes('ecs'))) {
// Extract cluster name from server group name (remove version suffix)
const serverGroupParts = input.serverGroup.split('-');
let clusterName = input.serverGroup;
if (serverGroupParts.length > 1 && serverGroupParts[serverGroupParts.length - 1].match(/^v\d+$/)) {
clusterName = serverGroupParts.slice(0, -1).join('-');
}

// Use clusters parameter with account:clusterName format
return UrlBuilderUtils.buildUrl(href, { clusters: ${input.account}:${clusterName} });
}

// For other providers, use standard parameters
return UrlBuilderUtils.buildUrl(href, { q: input.serverGroup, acct: input.account, reg: input.region });

Testing

Testing was performed in an environment where the onDemandClusterThreshold was exceeded.

Before the fix:
URL: /#/applications/myapp/serverGroups?q=my-ecs-service-v001&acct=my-account&reg=us-west-2
Result: Empty view, no server group details displayed

After the fix:
URL: /#/applications/myapp/serverGroups?clusters=my-account:my-ecs-service
Result: Successfully displays the ECS server group details

The fix has been verified with various ECS server group naming patterns, including those with and without version suffixes.

Impact

This change:

…10171)

* fix(core): Always use clusters parameter for ECS server group URLs

* fix(core): Extend server group URL fix to handle both ECS and AWS providers

(cherry picked from commit 3f2418e)
@edgarulg edgarulg added the ready to merge Reviewed and ready for merge label Apr 21, 2025
@edgarulg edgarulg merged commit 127fa90 into release-1.36.x Apr 21, 2025
2 checks passed
@edgarulg edgarulg deleted the mergify/bp/release-1.36.x/pr-10171 branch April 21, 2025 17:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready to merge Reviewed and ready for merge target-release/1.36

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants