Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AWS ListDeployedDatabaseServices when there's no ECS Cluster #50843

Merged

Conversation

marcoandredinis
Copy link
Contributor

Calling the AWS API ecs:ListServices with a non-existent ECS Cluster name will return a 400 w/ ClusterNotFoundException.

The existing code was not handling that error and a raw error was returned.

This PR changes the logic to ensure that case is handled and that the ListDeployedDatabaseServices returns an empty list.

An alternative would be to call the ListClusters beforehand, but that would increase the number of API calls we do to external services.

Calling the AWS API `ecs:ListServices` with a non-existent ECS Cluster
name will return a 400 w/ ClusterNotFoundException.

The existing code was not handling that error and a raw error was
returned.

This PR changes the logic to ensure that case is handled and that the
ListDeployedDatabaseServices returns an empty list.

An alternative would be to call the ListClusters beforehand, but that
would increase the number of API calls we do to external services.
@marcoandredinis marcoandredinis added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v17 labels Jan 7, 2025
@github-actions github-actions bot requested review from kiosion and strideynet January 7, 2025 19:39
Copy link
Contributor

@kiosion kiosion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds sane to me.

@marcoandredinis marcoandredinis added this pull request to the merge queue Jan 9, 2025
Merged via the queue into master with commit 4b2a0da Jan 9, 2025
43 checks passed
@marcoandredinis marcoandredinis deleted the marco/awsoidc-listdatabaseservices-fix-notfound branch January 9, 2025 10:06
@public-teleport-github-review-bot

@marcoandredinis See the table below for backport results.

Branch Result
branch/v17 Failed

marcoandredinis added a commit that referenced this pull request Jan 9, 2025
)

Calling the AWS API `ecs:ListServices` with a non-existent ECS Cluster
name will return a 400 w/ ClusterNotFoundException.

The existing code was not handling that error and a raw error was
returned.

This PR changes the logic to ensure that case is handled and that the
ListDeployedDatabaseServices returns an empty list.

An alternative would be to call the ListClusters beforehand, but that
would increase the number of API calls we do to external services.
github-merge-queue bot pushed a commit that referenced this pull request Jan 10, 2025
) (#50904)

Calling the AWS API `ecs:ListServices` with a non-existent ECS Cluster
name will return a 400 w/ ClusterNotFoundException.

The existing code was not handling that error and a raw error was
returned.

This PR changes the logic to ensure that case is handled and that the
ListDeployedDatabaseServices returns an empty list.

An alternative would be to call the ListClusters beforehand, but that
would increase the number of API calls we do to external services.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v17 no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants