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: (IAC-1362) Fix the V4M_ROUTING Validation Task #525

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

jarpat
Copy link
Contributor

@jarpat jarpat commented Feb 7, 2024

Changes

Fix the V4M - ensure supported value for V4M_ROUTING task to that the intersect function has the correct input format.

Cause:

It looks like when we updated the ansible version from 9.1.0->8.6.0 this problem started appearing. That version bump causes the ansible-core version to go from 2.15->2.16.
Looking at the release notes for 2.16 it looks like there was a bug fix around set filters that changed its behavior. We are updating this function so we don't rely on its previous "bugged" behavior.
https://github.com/ansible/ansible/blob/stable-2.16/changelogs/CHANGELOG-v2.16.rst#v2-16-0

From CHANGELOG:

  • Set filters intersect, difference, symmetric_difference and union now always return a list, never a set. Previously, a set would be returned if the inputs were a hashable type such as str, instead of a collection, such as a list or tuple.
  • Set filters intersect, difference, symmetric_difference and union now use set operations when the given items are hashable. Previously, list operations were performed unless the inputs were a hashable type such as str, instead of a collection, such as a list or tuple.

Example of behavior:
ansible-core 2.15

ansible.builtin.debug: # working bugged behavior
  msg: '{{ ["host-based", "path-based"] | intersect(V4M_ROUTING) }}'
["host-based"] 

ansible.builtin.debug: # checking backwards compat
  msg: '{{ ["host-based", "path-based", "a"] | intersect([V4M_ROUTING]) }}'
["host-based"]  

ansible-core 2.16

ansible.builtin.debug: # causing our issue
  msg: '{{ ["host-based", "path-based",] | intersect(V4M_ROUTING) }}'
[]    

ansible.builtin.debug: # causing our issue
  msg: '{{ ["host-based", "path-based", "a"] | intersect(V4M_ROUTING) }}'
["a"]    

ansible.builtin.debug: # fix as list
  msg: '{{ ["host-based", "path-based", "a"] | intersect([V4M_ROUTING]) }}'
["host-based"]

Tests

Scenario Provider kubernetes_version order cadence notes
1 GCP v1.27.10-gke.1152000 *** fast:2020 logging,monitoring,viya-monitoring

@jarpat jarpat added the bug Something isn't working label Feb 7, 2024
@jarpat jarpat self-assigned this Feb 7, 2024
Copy link
Member

@thpang thpang left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@dhoucgitter dhoucgitter left a comment

Choose a reason for hiding this comment

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

LGTM

@jarpat jarpat merged commit 92f2ab9 into staging Feb 7, 2024
3 checks passed
@jarpat jarpat deleted the IAC-1362 branch February 7, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants