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

ipv6: Fix joining IP and port number #2916

Merged
merged 1 commit into from Jan 23, 2020

Conversation

russellb
Copy link
Member

You can't just manually join an IP and port because that will break
with an IPv6 address. net.JoinHostPort() will do the right thing and
add square brackets around an IPv6 address.

Reported-by: Steven Hardy shardy@redhat.com

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 14, 2020
@stbenjam
Copy link
Member

I found a couple other instances with grep -r "Sprintf(.*http.*:.*)" . | grep -v vendor, can we fix them here?

@stbenjam
Copy link
Member

stbenjam commented Jan 14, 2020

Maybe this one too?

client, err := ssh.NewClient("core", fmt.Sprintf("%s:%d", bootstrap, port), gatherBootstrapOpts.sshKeys)

@danwinship
Copy link
Contributor

PR changes look right but maybe add unit tests? All of the places @stbenjam pointed out also look like they need updating. (For the ones with no port the simplest fix would be to explicitly specify port 80 so you can use net.JoinHostPort)

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 15, 2020
@russellb
Copy link
Member Author

I've updated this PR to address more places where similar problems existed. I haven't added unit tests though, since the changes seem pretty trivial. I'll add them if someone insists, though. :-)

@stbenjam
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2020
@stbenjam
Copy link
Member

/assign @fabianofranz

@fabianofranz
Copy link
Member

LGTM, reassigning for approval
/assign @wking

@stbenjam
Copy link
Member

/label platform/baremetal

(For metal3 CI)

@openshift-ci-robot openshift-ci-robot added the platform/baremetal IPI bare metal hosts platform label Jan 15, 2020
@metal3ci
Copy link

Build FAILURE, see build http://10.8.144.11:8080/job/dev-tools/1424/

@metal3ci
Copy link

Build FAILURE, see build http://10.8.144.11:8080/job/dev-tools/1425/

@fabianofranz
Copy link
Member

/retest

@wking
Copy link
Member

wking commented Jan 16, 2020

/lgtm

@sdodson
Copy link
Member

sdodson commented Jan 16, 2020

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sdodson

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@fabianofranz
Copy link
Member

/retest

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2020
You can't just manually join an IP and port because that will break
with an IPv6 address.  net.JoinHostPort() will do the right thing and
add square brackets around an IPv6 address.

Anywhere we may be using an IPv6 address in a URL needs similar
handling.  We need to ensure the IPv6 address always has square
brackets in this case.  An easy way to do this is to always specify
the port number explicitly so we can use net.JoinHostPort().

Reported-by: Steven Hardy <shardy@redhat.com>
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 22, 2020
@stbenjam
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2020
@hardys
Copy link
Contributor

hardys commented Jan 22, 2020

/lgtm

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@metal3ci
Copy link

Build SUCCESS, see build http://10.8.144.11:8080/job/dev-tools/1435/

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2020

@russellb: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-libvirt 74c3720 link /test e2e-libvirt
ci/prow/e2e-aws-fips 74c3720 link /test e2e-aws-fips
ci/prow/e2e-aws-scaleup-rhel7 74c3720 link /test e2e-aws-scaleup-rhel7

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 38840de into openshift:master Jan 23, 2020
@russellb
Copy link
Member Author

/cherry-pick release-4.3

@openshift-cherrypick-robot

@russellb: #2916 failed to apply on top of branch "release-4.3":

error: Failed to merge in the changes.
Using index info to reconstruct a base tree...
M	cmd/openshift-install/gather.go
M	pkg/asset/ignition/machine/node.go
M	pkg/tfvars/baremetal/baremetal.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/tfvars/baremetal/baremetal.go
Auto-merging pkg/asset/ignition/machine/node.go
CONFLICT (content): Merge conflict in pkg/asset/ignition/machine/node.go
Auto-merging cmd/openshift-install/gather.go
Patch failed at 0001 ipv6: Fix IPv6 address encoding

In response to this:

/cherry-pick release-4.3

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.

@russellb
Copy link
Member Author

4.3 backport is here: #2977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. platform/baremetal IPI bare metal hosts platform size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet