-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Conversation
pkg/model/components/context.go
Outdated
@@ -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" |
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.
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.
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.
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.
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?
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.
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.
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.
agree
/lgtm |
/approve |
[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 |
/retest prow timeout |
ref:#8238