Skip to content

Commit

Permalink
Correct prefix replacement in network names
Browse files Browse the repository at this point in the history
Usually we have `cifmw-` prefix, but the `replace` was looking for
`cifmw_` instead.
While it didn't create any issue in CI nor apparently in most of the
other scenarios, DCN had an issue.

This patch replaces the `replace` by `regex_replace` to ensure we're
properly catching both of `cifmw_` and `cifmw-` like some other places.
  • Loading branch information
cjeanner authored and openshift-merge-bot[bot] committed Jul 1, 2024
1 parent 7713020 commit 047a4d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/libvirt_manager/tasks/reserve_dnsmasq_ips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
vars:
_net_name: >-
{{ (net.name is match '.*osp_trunk$') | ternary('ctlplane', net.name) }}
_cleaned_netname: "{{ _net_name | replace('cifmw_', '') }}"
_cleaned_netname: "{{ _net_name | regex_replace('^cifmw[_-]', '') }}"
_net_data: "{{ host_data.value.networks[_cleaned_netname] }}"
_ocp_name: >-
{{
Expand Down Expand Up @@ -48,7 +48,7 @@
vars:
_net_name: >-
{{ (net.name is match '.*osp_trunk$') | ternary('ctlplane', net.name) }}
_cleaned_netname: "{{ _net_name | replace('cifmw_', '') }}"
_cleaned_netname: "{{ _net_name | regex_replace('^cifmw[_-]', '') }}"
_net_data: "{{ host_data.value.networks[_cleaned_netname] }}"
_ocp_name: >-
{{
Expand Down

0 comments on commit 047a4d6

Please sign in to comment.