-
Notifications
You must be signed in to change notification settings - Fork 66
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
detect ipv6 dest addr and pass with [] to rsync #405
detect ipv6 dest addr and pass with [] to rsync #405
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tesshuflower The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8bcd849
to
3a7bd58
Compare
Signed-off-by: Tesshu Flower <[email protected]>
3a7bd58
to
bf91b95
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
=======================================
+ Coverage 64.1% 64.2% +0.1%
=======================================
Files 44 45 +1
Lines 5171 5236 +65
=======================================
+ Hits 3317 3364 +47
- Misses 1657 1671 +14
- Partials 197 201 +4
|
/cc @JohnStrunk John, do you mind taking a look at this? I wasn't able to get an easily accessible ipv6 env so haven't re-tested, but have been using this patch in other non-ipv6 rsync tests. |
mover-rsync/source.sh
Outdated
if [[ "$DESTINATION_ADDRESS" == *"::"* || "$DESTINATION_ADDRESS" == *":"*":"*":"*":"*":"*":"*":"* ]]; then | ||
echo "Destination address $DESTINATION_ADDRESS is ipv6" | ||
if [[ "$DESTINATION_ADDRESS" != *"["*"]"* ]]; then | ||
URL_DESTINATION_ADDRESS="[$DESTINATION_ADDRESS]" | ||
fi | ||
fi |
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.
The matching makes me nervous. What about bash regular expressions:
# Looking for either:
# 1) 8 groups of hex digits separated by ":"
# 2) a "::" in the string
IPV6_REGEX='(([0-9a-fA-F]{0,4}:){7}[0-9a-fA-F]{0,4})|(::)'
if [[ "$DESTINATION_ADDRESS" =~ $IPV6_REGEX ]]; then
echo "It's IPv6"
fi
if [[ ! "$DESTINATION_ADDRESS" =~ \[.*\] ]]; then
echo "no brackets"
fi
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.
That's much nicer than what I had - I'm terrible with regex's so threw my version together fast before I lost that ipv6 env...I've done a bunch of different address checks and I think your suggestion looks good to me - will update...
Signed-off-by: Tesshu Flower <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
/lgtm |
/cherrypick release-0.5 |
@tesshuflower: new pull request created: #437 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Tesshu Flower [email protected]
Describe what this PR does
Rsync if provided with an IPv6 address needs to use the address in the format [ipv6addr]. This is a URL format.
In the mover script, attempt to detect if the destination address is an ipv6 address and wrap with [] only if it does not already contain []. This hopefully avoids issues with urls that are already formatted correctly.
Is there anything that requires special attention?
Related issues:
#402