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

Handle error return if portString parsing has error #83871

Closed
wants to merge 1 commit into from

Conversation

tedyu
Copy link
Contributor

@tedyu tedyu commented Oct 13, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
In componentStatusStorage#serversToValidate, the error return from strconv.Atoi is ignored.

When portString parsing has error, we should handle it.

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 13, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tedyu
To complete the pull request process, please assign deads2k
You can assign the PR to them by writing /assign @deads2k in a comment when ready.

The full list of commands accepted by this bot can be found 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

@tedyu
Copy link
Contributor Author

tedyu commented Oct 13, 2019

/test pull-kubernetes-integration

@whs-dot-hk
Copy link

Hi, @tedyu

looks like etcdUrl.Host not contains colon will have

null port and address now

@aojea
Copy link
Member

aojea commented Oct 13, 2019

Hi, @tedyu

looks like etcdUrl.Host not contains colon will have

null port and address now

yeah, if the etcdUrl.Hot does not contain a colon the if is not matching the err variable generated but the string conversion.
also,I guess that if there is an error parsing the port we should handle the error instead of using the default port,

@tedyu
Copy link
Contributor Author

tedyu commented Oct 14, 2019

@aojea @whs-dot-hk
Please take another look.

@tedyu tedyu changed the title Use default port if portString parsing has error Handle error return if portString parsing has error Oct 14, 2019
@whs-dot-hk
Copy link

Yes, it looks fine now

but I am not a member of kubernetes to approve

@tedyu
Copy link
Contributor Author

tedyu commented Oct 14, 2019

/assign @liggitt

@liggitt
Copy link
Member

liggitt commented Oct 14, 2019

Thanks for the PR, but https://github.com/kubernetes/kubernetes/pull/82680/files#diff-e735088e40a414f069432ee1deacd83eR361 is already open sweeping all strconv use for port parsing

@liggitt
Copy link
Member

liggitt commented Oct 14, 2019

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closed this PR.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants