mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-05 15:37:35 +00:00
Update hcsshim and gowinio for Windows Overlay
This commit is contained in:
23
vendor/github.com/Microsoft/hcsshim/internal/longpath/BUILD
generated
vendored
Normal file
23
vendor/github.com/Microsoft/hcsshim/internal/longpath/BUILD
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["longpath.go"],
|
||||
importmap = "k8s.io/kubernetes/vendor/github.com/Microsoft/hcsshim/internal/longpath",
|
||||
importpath = "github.com/Microsoft/hcsshim/internal/longpath",
|
||||
visibility = ["//vendor/github.com/Microsoft/hcsshim:__subpackages__"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
24
vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go
generated
vendored
Normal file
24
vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package longpath
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// LongAbs makes a path absolute and returns it in NT long path form.
|
||||
func LongAbs(path string) (string, error) {
|
||||
if strings.HasPrefix(path, `\\?\`) || strings.HasPrefix(path, `\\.\`) {
|
||||
return path, nil
|
||||
}
|
||||
if !filepath.IsAbs(path) {
|
||||
absPath, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
path = absPath
|
||||
}
|
||||
if strings.HasPrefix(path, `\\`) {
|
||||
return `\\?\UNC\` + path[2:], nil
|
||||
}
|
||||
return `\\?\` + path, nil
|
||||
}
|
||||
Reference in New Issue
Block a user