From b4ce777b7959a9aad5d0a864a5cae689c80275f4 Mon Sep 17 00:00:00 2001 From: Ruslan Gustomiasov Date: Sun, 14 Jul 2019 17:37:38 +0200 Subject: [PATCH] remove github.com/kardianos/osext --- Godeps/LICENSES | 35 -------- go.mod | 2 - go.sum | 2 - test/e2e_node/BUILD | 1 - test/e2e_node/e2e_node_suite_test.go | 3 +- test/e2e_node/services/BUILD | 1 - test/e2e_node/services/services.go | 3 +- vendor/BUILD | 1 - vendor/github.com/kardianos/osext/BUILD | 29 ------- vendor/github.com/kardianos/osext/LICENSE | 27 ------- vendor/github.com/kardianos/osext/README.md | 14 ---- vendor/github.com/kardianos/osext/osext.go | 27 ------- .../github.com/kardianos/osext/osext_plan9.go | 20 ----- .../kardianos/osext/osext_procfs.go | 36 --------- .../kardianos/osext/osext_sysctl.go | 79 ------------------- .../kardianos/osext/osext_windows.go | 34 -------- vendor/modules.txt | 2 - 17 files changed, 2 insertions(+), 314 deletions(-) delete mode 100644 vendor/github.com/kardianos/osext/BUILD delete mode 100644 vendor/github.com/kardianos/osext/LICENSE delete mode 100644 vendor/github.com/kardianos/osext/README.md delete mode 100644 vendor/github.com/kardianos/osext/osext.go delete mode 100644 vendor/github.com/kardianos/osext/osext_plan9.go delete mode 100644 vendor/github.com/kardianos/osext/osext_procfs.go delete mode 100644 vendor/github.com/kardianos/osext/osext_sysctl.go delete mode 100644 vendor/github.com/kardianos/osext/osext_windows.go diff --git a/Godeps/LICENSES b/Godeps/LICENSES index 9e8ddf07b0d..b5155e9ccbd 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -11979,41 +11979,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================ -================================================================================ -= vendor/github.com/kardianos/osext licensed under: = - -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -= vendor/github.com/kardianos/osext/LICENSE 591778525c869cdde0ab5a1bf283cd81 -================================================================================ - - ================================================================================ = vendor/github.com/karrick/godirwalk licensed under: = diff --git a/go.mod b/go.mod index db5817d0195..b70c80a94ca 100644 --- a/go.mod +++ b/go.mod @@ -87,7 +87,6 @@ require ( github.com/jonboulle/clockwork v0.1.0 github.com/json-iterator/go v1.1.6 github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 - github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22 github.com/karrick/godirwalk v1.7.5 // indirect github.com/libopenstorage/openstorage v0.0.0-20170906232338-093a0c388875 github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de @@ -312,7 +311,6 @@ replace ( github.com/json-iterator/go => github.com/json-iterator/go v1.1.6 github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 github.com/jtolds/gls => github.com/jtolds/gls v4.20.0+incompatible - github.com/kardianos/osext => github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22 github.com/karrick/godirwalk => github.com/karrick/godirwalk v1.7.5 github.com/klauspost/cpuid => github.com/klauspost/cpuid v1.2.0 github.com/konsorten/go-windows-terminal-sequences => github.com/konsorten/go-windows-terminal-sequences v1.0.1 diff --git a/go.sum b/go.sum index 28e5996b449..dd60b199bdf 100644 --- a/go.sum +++ b/go.sum @@ -243,8 +243,6 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdl github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22 h1:eLCQd4nxsC7sumkwNg4OiB6bGiD7I5l1MSfBAxmxkKQ= -github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.7.5 h1:VbzFqwXwNbAZoA6W5odrLr+hKK197CcENcPh6E/gJ0M= github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= diff --git a/test/e2e_node/BUILD b/test/e2e_node/BUILD index 6d5e3db81f2..9028683e52f 100644 --- a/test/e2e_node/BUILD +++ b/test/e2e_node/BUILD @@ -196,7 +196,6 @@ go_test( "//test/e2e/framework/config:go_default_library", "//test/e2e/framework/testfiles:go_default_library", "//test/e2e/generated:go_default_library", - "//vendor/github.com/kardianos/osext:go_default_library", "//vendor/github.com/onsi/ginkgo/config:go_default_library", "//vendor/github.com/onsi/ginkgo/reporters:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", diff --git a/test/e2e_node/e2e_node_suite_test.go b/test/e2e_node/e2e_node_suite_test.go index 409d5286f0d..0b399390f93 100644 --- a/test/e2e_node/e2e_node_suite_test.go +++ b/test/e2e_node/e2e_node_suite_test.go @@ -46,7 +46,6 @@ import ( "k8s.io/kubernetes/test/e2e/generated" "k8s.io/kubernetes/test/e2e_node/services" - "github.com/kardianos/osext" . "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" morereporters "github.com/onsi/ginkgo/reporters" @@ -204,7 +203,7 @@ var _ = SynchronizedAfterSuite(func() {}, func() { // validateSystem runs system validation in a separate process and returns error if validation fails. func validateSystem() error { - testBin, err := osext.Executable() + testBin, err := os.Executable() if err != nil { return fmt.Errorf("can't get current binary: %v", err) } diff --git a/test/e2e_node/services/BUILD b/test/e2e_node/services/BUILD index bcda62a6a90..b1232d47830 100644 --- a/test/e2e_node/services/BUILD +++ b/test/e2e_node/services/BUILD @@ -40,7 +40,6 @@ go_library( "//test/e2e/framework:go_default_library", "//test/e2e_node/builder:go_default_library", "//test/e2e_node/remote:go_default_library", - "//vendor/github.com/kardianos/osext:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], diff --git a/test/e2e_node/services/services.go b/test/e2e_node/services/services.go index 931741a4184..be6b20313df 100644 --- a/test/e2e_node/services/services.go +++ b/test/e2e_node/services/services.go @@ -24,7 +24,6 @@ import ( "path" "testing" - "github.com/kardianos/osext" "k8s.io/klog" utilfeature "k8s.io/apiserver/pkg/util/feature" @@ -127,7 +126,7 @@ const ( // startInternalServices starts the internal services in a separate process. func (e *E2EServices) startInternalServices() (*server, error) { - testBin, err := osext.Executable() + testBin, err := os.Executable() if err != nil { return nil, fmt.Errorf("can't get current binary: %v", err) } diff --git a/vendor/BUILD b/vendor/BUILD index a5b459ba9cc..749aaf216b7 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -275,7 +275,6 @@ filegroup( "//vendor/github.com/jonboulle/clockwork:all-srcs", "//vendor/github.com/json-iterator/go:all-srcs", "//vendor/github.com/jstemmer/go-junit-report:all-srcs", - "//vendor/github.com/kardianos/osext:all-srcs", "//vendor/github.com/karrick/godirwalk:all-srcs", "//vendor/github.com/konsorten/go-windows-terminal-sequences:all-srcs", "//vendor/github.com/libopenstorage/openstorage/api:all-srcs", diff --git a/vendor/github.com/kardianos/osext/BUILD b/vendor/github.com/kardianos/osext/BUILD deleted file mode 100644 index d25fe8025a8..00000000000 --- a/vendor/github.com/kardianos/osext/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "osext.go", - "osext_plan9.go", - "osext_procfs.go", - "osext_sysctl.go", - "osext_windows.go", - ], - importmap = "k8s.io/kubernetes/vendor/github.com/kardianos/osext", - importpath = "github.com/kardianos/osext", - visibility = ["//visibility:public"], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/vendor/github.com/kardianos/osext/LICENSE b/vendor/github.com/kardianos/osext/LICENSE deleted file mode 100644 index 74487567632..00000000000 --- a/vendor/github.com/kardianos/osext/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/kardianos/osext/README.md b/vendor/github.com/kardianos/osext/README.md deleted file mode 100644 index 820e1ecb544..00000000000 --- a/vendor/github.com/kardianos/osext/README.md +++ /dev/null @@ -1,14 +0,0 @@ -### Extensions to the "os" package. - -## Find the current Executable and ExecutableFolder. - -There is sometimes utility in finding the current executable file -that is running. This can be used for upgrading the current executable -or finding resources located relative to the executable file. - -Multi-platform and supports: - * Linux - * OS X - * Windows - * Plan 9 - * BSDs. diff --git a/vendor/github.com/kardianos/osext/osext.go b/vendor/github.com/kardianos/osext/osext.go deleted file mode 100644 index 18f1e39cc24..00000000000 --- a/vendor/github.com/kardianos/osext/osext.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Extensions to the standard "os" package. -package osext // import "github.com/kardianos/osext" - -import "path/filepath" - -// Executable returns an absolute path that can be used to -// re-invoke the current program. -// It may not be valid after the current program exits. -func Executable() (string, error) { - p, err := executable() - return filepath.Clean(p), err -} - -// Returns same path as Executable, returns just the folder -// path. Excludes the executable name. -func ExecutableFolder() (string, error) { - p, err := Executable() - if err != nil { - return "", err - } - folder, _ := filepath.Split(p) - return folder, nil -} diff --git a/vendor/github.com/kardianos/osext/osext_plan9.go b/vendor/github.com/kardianos/osext/osext_plan9.go deleted file mode 100644 index 655750c5426..00000000000 --- a/vendor/github.com/kardianos/osext/osext_plan9.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package osext - -import ( - "os" - "strconv" - "syscall" -) - -func executable() (string, error) { - f, err := os.Open("/proc/" + strconv.Itoa(os.Getpid()) + "/text") - if err != nil { - return "", err - } - defer f.Close() - return syscall.Fd2path(int(f.Fd())) -} diff --git a/vendor/github.com/kardianos/osext/osext_procfs.go b/vendor/github.com/kardianos/osext/osext_procfs.go deleted file mode 100644 index b2598bc77a4..00000000000 --- a/vendor/github.com/kardianos/osext/osext_procfs.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux netbsd openbsd solaris dragonfly - -package osext - -import ( - "errors" - "fmt" - "os" - "runtime" - "strings" -) - -func executable() (string, error) { - switch runtime.GOOS { - case "linux": - const deletedTag = " (deleted)" - execpath, err := os.Readlink("/proc/self/exe") - if err != nil { - return execpath, err - } - execpath = strings.TrimSuffix(execpath, deletedTag) - execpath = strings.TrimPrefix(execpath, deletedTag) - return execpath, nil - case "netbsd": - return os.Readlink("/proc/curproc/exe") - case "openbsd", "dragonfly": - return os.Readlink("/proc/curproc/file") - case "solaris": - return os.Readlink(fmt.Sprintf("/proc/%d/path/a.out", os.Getpid())) - } - return "", errors.New("ExecPath not implemented for " + runtime.GOOS) -} diff --git a/vendor/github.com/kardianos/osext/osext_sysctl.go b/vendor/github.com/kardianos/osext/osext_sysctl.go deleted file mode 100644 index b66cac878c4..00000000000 --- a/vendor/github.com/kardianos/osext/osext_sysctl.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd - -package osext - -import ( - "os" - "path/filepath" - "runtime" - "syscall" - "unsafe" -) - -var initCwd, initCwdErr = os.Getwd() - -func executable() (string, error) { - var mib [4]int32 - switch runtime.GOOS { - case "freebsd": - mib = [4]int32{1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1} - case "darwin": - mib = [4]int32{1 /* CTL_KERN */, 38 /* KERN_PROCARGS */, int32(os.Getpid()), -1} - } - - n := uintptr(0) - // Get length. - _, _, errNum := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), 4, 0, uintptr(unsafe.Pointer(&n)), 0, 0) - if errNum != 0 { - return "", errNum - } - if n == 0 { // This shouldn't happen. - return "", nil - } - buf := make([]byte, n) - _, _, errNum = syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), 4, uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&n)), 0, 0) - if errNum != 0 { - return "", errNum - } - if n == 0 { // This shouldn't happen. - return "", nil - } - for i, v := range buf { - if v == 0 { - buf = buf[:i] - break - } - } - var err error - execPath := string(buf) - // execPath will not be empty due to above checks. - // Try to get the absolute path if the execPath is not rooted. - if execPath[0] != '/' { - execPath, err = getAbs(execPath) - if err != nil { - return execPath, err - } - } - // For darwin KERN_PROCARGS may return the path to a symlink rather than the - // actual executable. - if runtime.GOOS == "darwin" { - if execPath, err = filepath.EvalSymlinks(execPath); err != nil { - return execPath, err - } - } - return execPath, nil -} - -func getAbs(execPath string) (string, error) { - if initCwdErr != nil { - return execPath, initCwdErr - } - // The execPath may begin with a "../" or a "./" so clean it first. - // Join the two paths, trailing and starting slashes undetermined, so use - // the generic Join function. - return filepath.Join(initCwd, filepath.Clean(execPath)), nil -} diff --git a/vendor/github.com/kardianos/osext/osext_windows.go b/vendor/github.com/kardianos/osext/osext_windows.go deleted file mode 100644 index 72d282cf8c0..00000000000 --- a/vendor/github.com/kardianos/osext/osext_windows.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package osext - -import ( - "syscall" - "unicode/utf16" - "unsafe" -) - -var ( - kernel = syscall.MustLoadDLL("kernel32.dll") - getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW") -) - -// GetModuleFileName() with hModule = NULL -func executable() (exePath string, err error) { - return getModuleFileName() -} - -func getModuleFileName() (string, error) { - var n uint32 - b := make([]uint16, syscall.MAX_PATH) - size := uint32(len(b)) - - r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size)) - n = uint32(r0) - if n == 0 { - return "", e1 - } - return string(utf16.Decode(b[0:n])), nil -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 49b71cfbc02..1e58f0d64ce 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -565,8 +565,6 @@ github.com/json-iterator/go github.com/jstemmer/go-junit-report github.com/jstemmer/go-junit-report/formatter github.com/jstemmer/go-junit-report/parser -# github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22 => github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22 -github.com/kardianos/osext # github.com/karrick/godirwalk v1.7.5 => github.com/karrick/godirwalk v1.7.5 github.com/karrick/godirwalk # github.com/konsorten/go-windows-terminal-sequences v1.0.1 => github.com/konsorten/go-windows-terminal-sequences v1.0.1