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

Move 'path' package usage to 'path/filepath'. #87713

Merged
merged 1 commit into from Feb 4, 2020

Conversation

kkmsft
Copy link
Contributor

@kkmsft kkmsft commented Jan 31, 2020

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind api-change

/kind bug

/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

In case of windows, the path package functions such as 'Dir' returns faulty directory path.
For eg: 'path.Dir' on 'c:\var\lib\kubelet\pods' returns '.', where as the result should
have been 'c:\var\lib\kubelet'. The filepath package returns the right values.

> cat .\path.go

package main 
import(
        "fmt"
        "path"
        filepath "path/filepath"
)

func main() {
       p := "c:\\var\\lib\\kubelet\\pods"
       dir := path.Dir(p)
       dir1 := filepath.Dir(p)
       fmt.Printf("Just path: %s\n", dir)
       fmt.Printf("File path: %s\n", dir1)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
}                                                  

> .\path.exe 

Just path: .
File path: c:\var\lib\kubelet

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

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


In case of windows, the path package functions such as 'Dir' returns faulty directory path.
For eg: 'path.Dir' on 'c:\var\lib\kubelet\pods' returns '.', where as the result should
have been 'c:\var\lib\kubelet'. The filepath package returns the right values.
@k8s-ci-robot k8s-ci-robot added 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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. 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 Jan 31, 2020
@kkmsft
Copy link
Contributor Author

kkmsft commented Jan 31, 2020

/cc @ddebroy @jingxu97 @PatrickLang

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 31, 2020
@kkmsft
Copy link
Contributor Author

kkmsft commented Jan 31, 2020

/retest

3 similar comments
@kkmsft
Copy link
Contributor Author

kkmsft commented Jan 31, 2020

/retest

@kkmsft
Copy link
Contributor Author

kkmsft commented Jan 31, 2020

/retest

@kkmsft
Copy link
Contributor Author

kkmsft commented Jan 31, 2020

/retest

@kkmsft
Copy link
Contributor Author

kkmsft commented Feb 3, 2020

/cc @andyzhangx

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/lgtm
/priority important-soon
/sig windows

'path/filepath' supports windows.

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/windows Categorizes an issue or PR as relevant to SIG Windows. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 3, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2020
@jsafrane
Copy link
Member

jsafrane commented Feb 3, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, kkmsft

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 Feb 3, 2020
@kkmsft
Copy link
Contributor Author

kkmsft commented Feb 3, 2020

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Feb 3, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 76c8964 into kubernetes:master Feb 4, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Feb 4, 2020
k8s-ci-robot added a commit that referenced this pull request Feb 7, 2020
Move 'path' package usage to 'path/filepath' (repeat the #87713)
@PatrickLang PatrickLang added this to Done (v1.18) in SIG-Windows Feb 20, 2020
@kkmsft kkmsft deleted the filepath-fixes-windows branch March 6, 2020 00:08
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/windows Categorizes an issue or PR as relevant to SIG Windows. 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