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

MTL-1925 Fix metal.ipv4 #52

Merged
merged 1 commit into from
Aug 22, 2022
Merged

MTL-1925 Fix metal.ipv4 #52

merged 1 commit into from
Aug 22, 2022

Conversation

rustydb
Copy link
Contributor

@rustydb rustydb commented Aug 21, 2022

Summary and Scope

Issue Type

  • Bugfix Pull Request

When metal.ipv4 was set to 1 it was ignored by ping and curl calls. This change restores the functionality.

Simple example showing how it works, why 0 is changed to '' and why 1 allows the substitution.

ncn-w004:~ # [ "${metal_ipv4}" = 0 ] && metal_ipv4=''
+ '[' 0 = 0 ']'
+ metal_ipv4=
ncn-w004:~ # ping ${metal_ipv4:+-4} ncn-w004
+ ping ncn-w004
PING ncn-w004(surtur-ncn-w004.local (::1)) 56 data bytes
64 bytes from surtur-ncn-w004.local (::1): icmp_seq=1 ttl=64 time=0.044 ms
^C
--- ncn-w004 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.044/0.044/0.044/0.000 ms
ncn-w004:~ # ^C
ncn-w004:~ # metal_ipv4=1
+ metal_ipv4=1
ncn-w004:~ # [ "${metal_ipv4}" = 0 ] && metal_ipv4=''
+ '[' 1 = 0 ']'
ncn-w004:~ # ping ${metal_ipv4:+-4} ncn-w004
+ ping -4 ncn-w004

Prerequisites

  • I have included documentation in my PR (or it is not required)
  • I tested this on internal system (if yes, please include results or a description of the test)
  • I tested this on a vshasta system (if yes, please include results or a description of the test)

Idempotency

Risks and Mitigations

When `metal.ipv4` was set to `1` it was ignored by `ping` and `curl`
calls. This change restores the functionality.
@rustydb rustydb requested a review from a team as a code owner August 21, 2022 21:53
@rustydb rustydb merged commit 298f5a9 into main Aug 22, 2022
@rustydb rustydb deleted the MTL-1925-fix-ipv4-only branch August 22, 2022 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants