-
Notifications
You must be signed in to change notification settings - Fork 398
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
ecs_service_info lists all services in all clusters when no cluster attribute is given #2058
Open
b0tting
wants to merge
11
commits into
ansible-collections:main
Choose a base branch
from
b0tting:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4de8ebd
Add cluster(less) query to ecs_service_info
markotting eb16fcf
Added test to validate commits with no cluster
markotting d381118
Fixed not being able to deal with service names
markotting c1028cf
Fixed using the wrong service name in tests
markotting 0d1ebee
Modified integration test. Given that we can now pass multiple cluste…
markotting 253a097
Last fix to integration tests
markotting eed692d
Update plugins/modules/ecs_service_info.py
b0tting f63e625
Update plugins/modules/ecs_service_info.py
b0tting 049e728
Update plugins/modules/ecs_service_info.py
b0tting 456012c
Removed explicit error when no clusters or services exist
markotting 2dc19a3
Merge branch 'main' of github.com:b0tting/community.aws into main
markotting File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/integration/targets/ecs_cluster/tasks/10_ecs_cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service name per cluster are unique. What will happen when more than one cluster contains the same service name?
Will the last service name overwrite the first service name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is an issue when the details flag is not added or set to false. This would return just the list of services with no attributes. Considering the scenario of 2 clusters, with the same HelloWorld service.
..would get you a list of 2 service ARNs
..would get you a single ARN
But giving service names (not service ARNs) with details: false in the current ecs_service_info returns you just the existing services. So in this scenario:
..would in the current module fail, or force you to add a cluster and return just [HelloWorld]. But what should be the response if you have the given HelloWorld scenario? [HelloWorld] is ambiguous right? But adding cluster info or returning a cluster:service dict would be a change that changes the module response compared to the current version.
I am not an experienced contributer. Do you have a suggestion how to proceed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah maybe I also misinterpreted the return value
cluster_services[cluster] = ...
So it's already grouped by cluster.
I think this is the only solution. That would also mean that it is a breaking change and the changes will release with 8.0.0 and not in 7.2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I need some guidance in what would be good form for the output.
So (with details: false) the current output:
If I were to slide in the clusters I could add them as an extra level below services:
Or should this be more explicit (and renaming the root item) in the lines of:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any opinions @tremble @alinabuzachis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, current return value for
details: false
isusing
details: true
results inI guess we should keep this structure.
And once
cluster
name isomit
,details
should be automatically set totrue
This won't break any backwards compatiblity and won't return any ambiguous results in case a service name exist in more than one cluster.
What do you think @b0tting