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

remove // TODO path.Join here? #8701

Merged
merged 2 commits into from
Mar 10, 2020
Merged

remove // TODO path.Join here? #8701

merged 2 commits into from
Mar 10, 2020

Conversation

tanjunchen
Copy link
Member

@tanjunchen tanjunchen commented Mar 9, 2020

ref:#8238

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 9, 2020
@@ -177,8 +178,7 @@ func Image(component string, architecture string, clusterSpec *kops.ClusterSpec,
baseURL := clusterSpec.KubernetesVersion
baseURL = strings.TrimSuffix(baseURL, "/")

// TODO path.Join here?
tagURL := baseURL + "/bin/linux/" + architecture + "/" + component + ".docker_tag"
tagURL := path.Join(baseURL, "/bin/linux/", architecture, component) + ".docker_tag"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't "/bin/linux/" omit the leading and trailing slashes?

Why is the ".docker_tag" outside the path.Join? If component is the empty string, these two are not equivalent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that path.join will result "memfs://v1.10.0-download" to memfs:/v1.10.0-download/,it will fail. It's not reasonable to use this here.@johngmyers what do you say?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd have to parse the url and use path.Join on the path component only.

I'm skeptical of the value of using path.Join in this instance. It doesn't seem to be solving a problem that simple concatenation doesn't.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

@johngmyers
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 10, 2020
@rifelpet
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet, tanjunchen

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2020
@justinsb
Copy link
Member

/retest

prow timeout

@k8s-ci-robot k8s-ci-robot merged commit 7e09b1e into kubernetes:master Mar 10, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Mar 10, 2020
@tanjunchen tanjunchen deleted the remove-TODO01 branch March 10, 2020 02:57
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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

5 participants