fix(core): Always use clusters parameter for ECS server group URLs#10171
Conversation
|
thanks @shlomodaari! I think this bug is not only on ECS though. It must be in the AWS as well (since the ECS cluster view is basically the AWS asg with conventions). |
|
Hi @christosarvanitis, PLEASE don't merge this PR until we confirm other providers! |
|
FYI: The good part is that with this fix it should work when onDemandClusterThreshold is exceeded and also when it is disabled |
edgarulg
left a comment
There was a problem hiding this comment.
Thanks for working on this fix. The implementation looks good to me but I agree with @christosarvanitis this issue might be present in other providers as well.
I am leaving my approve because the initial issue is being fixed but we need to be sure other providers are not affected the same way.
|
Okay, this is fixing now ECS and AWS! |
|
@mergify backport release-1.38.x release-1.37.x release-1.36.x |
✅ Backports have been createdDetails
|
Fix ECS Server Group URLs When onDemandClusterThreshold is Exceeded
Problem
When viewing ECS server groups in Spinnaker and the
onDemandClusterThresholdis exceeded, the generated URLs fail to navigate to the correct server group. This happens because:clustersparameter for server group navigationq,acct, andregparameters which don't work properly for ECS when on-demand caching is disabledThis 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.buildmethod 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
onDemandClusterThresholdwas exceeded.Before the fix:
URL: /#/applications/myapp/serverGroups?q=my-ecs-service-v001&acct=my-account®=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:
onDemandClusterThresholdis exceeded