Skip to content

Commit

Permalink
postgresql: Cast sorted_old_postgres_pods as list (#1791)
Browse files Browse the repository at this point in the history
With ansible 2.9.27 (operator-sdk v1.27.0) then the reverse filter
returns an iterator so we need to cast it to list.
The behavior doesn't exist when using a more recent operator-sdk
version like v1.34.0 (ansible-core 2.15.8) but using the list
filter on that version works too (even if not needed)

"sorted_old_postgres_pods": "<list_reverseiterator object at 0x7f539eaa5610>"

Signed-off-by: Dimitri Savineau <[email protected]>
  • Loading branch information
dsavineau authored Mar 27, 2024
1 parent dc0e86b commit 80a9e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion roles/installer/tasks/database_configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
set_fact:
sorted_old_postgres_pods: "{{ filtered_old_postgres_pods |
sort(attribute='metadata.name') |
reverse }}"
reverse | list }}"
when: filtered_old_postgres_pods | length


Expand Down

0 comments on commit 80a9e8c

Please sign in to comment.