diff --git a/Godeps/LICENSES b/Godeps/LICENSES index a909a491ffb..5a4c87319ad 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -5739,6 +5739,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================ +================================================================================ += vendor/github.com/go-bindata/go-bindata licensed under: = + +This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication +license. Its contents can be found at: +http://creativecommons.org/publicdomain/zero/1.0 + += vendor/github.com/go-bindata/go-bindata/LICENSE 8dcedca69f7a474372829521f37954b1 +================================================================================ + + ================================================================================ = vendor/github.com/go-openapi/analysis licensed under: = @@ -11550,17 +11561,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================ -================================================================================ -= vendor/github.com/jteeuwen/go-bindata licensed under: = - -This work is subject to the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication -license. Its contents can be found at: -http://creativecommons.org/publicdomain/zero/1.0 - -= vendor/github.com/jteeuwen/go-bindata/LICENSE 8dcedca69f7a474372829521f37954b1 -================================================================================ - - ================================================================================ = vendor/github.com/kardianos/osext licensed under: = diff --git a/build/bindata.bzl b/build/bindata.bzl index f21f42e5777..8925f99cdaf 100644 --- a/build/bindata.bzl +++ b/build/bindata.bzl @@ -35,11 +35,11 @@ def go_bindata( srcs = srcs, outs = outs, cmd = """ - $(location //vendor/github.com/jteeuwen/go-bindata/go-bindata:go-bindata) \ + $(location //vendor/github.com/go-bindata/go-bindata/go-bindata:go-bindata) \ -o "$@" -pkg %s -prefix $$(pwd) %s $(SRCS) """ % (pkg, " ".join(args)), tools = [ - "//vendor/github.com/jteeuwen/go-bindata/go-bindata", + "//vendor/github.com/go-bindata/go-bindata/go-bindata", ], **kw ) diff --git a/build/root/Makefile.generated_files b/build/root/Makefile.generated_files index 6f354e25e7b..4892325569d 100644 --- a/build/root/Makefile.generated_files +++ b/build/root/Makefile.generated_files @@ -69,7 +69,7 @@ $(META_DIR)/$(GO_PKGDEPS_FILE): FORCE --prune k8s.io/kubernetes/staging \ --prune k8s.io/kubernetes/vendor \ k8s.io/kubernetes/vendor/k8s.io/... \ - github.com/jteeuwen/go-bindata/go-bindata/... \ + github.com/go-bindata/go-bindata/go-bindata/... \ > $@.tmp if ! cmp -s $@.tmp $@; then \ if [[ "$(DBG_CODEGEN)" == 1 ]]; then \ @@ -522,6 +522,6 @@ gen_bindata: $(BINDATA_GEN) FORCE # have to be rebuilt. In that case, make will forever see the dependency as # newer than the binary, and try to rebuild it over and over. So we touch it, # and make is happy. -$(BINDATA_GEN): $(k8s.io/kubernetes/vendor/github.com/jteeuwen/go-bindata/go-bindata) - KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/github.com/jteeuwen/go-bindata/go-bindata +$(BINDATA_GEN): $(k8s.io/kubernetes/vendor/github.com/go-bindata/go-bindata/go-bindata) + KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/github.com/go-bindata/go-bindata/go-bindata touch $@ diff --git a/build/tools.go b/build/tools.go index ca83ac93bce..1a54b4bfa9b 100644 --- a/build/tools.go +++ b/build/tools.go @@ -24,8 +24,8 @@ import ( _ "github.com/bazelbuild/buildtools/buildozer" _ "github.com/cespare/prettybench" _ "github.com/client9/misspell/cmd/misspell" + _ "github.com/go-bindata/go-bindata/go-bindata" _ "github.com/jstemmer/go-junit-report" - _ "github.com/jteeuwen/go-bindata/go-bindata" _ "github.com/onsi/ginkgo/ginkgo" _ "golang.org/x/lint/golint" _ "k8s.io/code-generator/cmd/go-to-protobuf" diff --git a/go.mod b/go.mod index df9198241eb..302c700fee3 100644 --- a/go.mod +++ b/go.mod @@ -57,6 +57,7 @@ require ( github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d github.com/fatih/camelcase v1.0.0 github.com/fsnotify/fsnotify v1.4.7 + github.com/go-bindata/go-bindata v3.1.1+incompatible github.com/go-openapi/loads v0.17.2 github.com/go-openapi/spec v0.17.2 github.com/go-openapi/strfmt v0.17.0 @@ -85,7 +86,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/jteeuwen/go-bindata v0.0.0-20151023091102-a0ff2567cfb7 github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22 github.com/karrick/godirwalk v1.7.5 // indirect github.com/kr/pretty v0.1.0 // indirect @@ -258,6 +258,7 @@ replace ( github.com/ghodss/yaml => github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4 github.com/globalsign/mgo => github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/go-acme/lego => github.com/go-acme/lego v2.5.0+incompatible + github.com/go-bindata/go-bindata => github.com/go-bindata/go-bindata v3.1.1+incompatible github.com/go-openapi/analysis => github.com/go-openapi/analysis v0.17.2 github.com/go-openapi/errors => github.com/go-openapi/errors v0.17.2 github.com/go-openapi/jsonpointer => github.com/go-openapi/jsonpointer v0.19.0 diff --git a/go.sum b/go.sum index 4730c589b9e..756b5206671 100644 --- a/go.sum +++ b/go.sum @@ -135,6 +135,8 @@ github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2H github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= +github.com/go-bindata/go-bindata v3.1.1+incompatible h1:tR4f0e4VTO7LK6B2YWyAoVEzG9ByG1wrXB4TL9+jiYg= +github.com/go-bindata/go-bindata v3.1.1+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-openapi/analysis v0.17.2 h1:eYp14J1o8TTSCzndHBtsNuckikV1PfZOSnx4BcBeu0c= github.com/go-openapi/analysis v0.17.2/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/errors v0.17.2 h1:azEQ8Fnx0jmtFF2fxsnmd6I0x6rsweUF63qqSO1NmKk= @@ -235,8 +237,6 @@ github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwK github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jteeuwen/go-bindata v0.0.0-20151023091102-a0ff2567cfb7 h1:fNOeTlrOg7VMXyGgvnHoqw6owD7hd3mKSlivApPJMzI= -github.com/jteeuwen/go-bindata v0.0.0-20151023091102-a0ff2567cfb7/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs= 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= diff --git a/pkg/kubectl/generated/bindata.go b/pkg/kubectl/generated/bindata.go index 2806b9b6536..100c2802e8b 100644 --- a/pkg/kubectl/generated/bindata.go +++ b/pkg/kubectl/generated/bindata.go @@ -1,4 +1,4 @@ -// Code generated by go-bindata. +// Package generated Code generated by go-bindata. (@generated) DO NOT EDIT. // sources: // translations/OWNERS // translations/extract.py @@ -26,8 +26,6 @@ // translations/test/default/LC_MESSAGES/k8s.po // translations/test/en_US/LC_MESSAGES/k8s.mo // translations/test/en_US/LC_MESSAGES/k8s.po -// DO NOT EDIT! - package generated import ( @@ -51,21 +49,32 @@ type bindataFileInfo struct { modTime time.Time } +// Name return file name func (fi bindataFileInfo) Name() string { return fi.name } + +// Size return file size func (fi bindataFileInfo) Size() int64 { return fi.size } + +// Mode return file mode func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } + +// Mode return file modify time func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } + +// IsDir return file whether a directory func (fi bindataFileInfo) IsDir() bool { - return false + return fi.mode&os.ModeDir != 0 } + +// Sys return file is sys mode func (fi bindataFileInfo) Sys() interface{} { return nil } diff --git a/vendor/BUILD b/vendor/BUILD index 71bd2c0fad5..d09e309fc1e 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -183,6 +183,7 @@ filegroup( "//vendor/github.com/ghodss/yaml:all-srcs", "//vendor/github.com/globalsign/mgo/bson:all-srcs", "//vendor/github.com/globalsign/mgo/internal/json:all-srcs", + "//vendor/github.com/go-bindata/go-bindata:all-srcs", "//vendor/github.com/go-openapi/analysis:all-srcs", "//vendor/github.com/go-openapi/errors:all-srcs", "//vendor/github.com/go-openapi/jsonpointer:all-srcs", @@ -272,7 +273,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/jteeuwen/go-bindata: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", diff --git a/vendor/github.com/go-bindata/go-bindata/.gitignore b/vendor/github.com/go-bindata/go-bindata/.gitignore new file mode 100644 index 00000000000..b9abe353d25 --- /dev/null +++ b/vendor/github.com/go-bindata/go-bindata/.gitignore @@ -0,0 +1,16 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Goland project files +.idea/ +*.iml diff --git a/vendor/github.com/jteeuwen/go-bindata/BUILD b/vendor/github.com/go-bindata/go-bindata/BUILD similarity index 75% rename from vendor/github.com/jteeuwen/go-bindata/BUILD rename to vendor/github.com/go-bindata/go-bindata/BUILD index a8fa9dcda72..5a618583866 100644 --- a/vendor/github.com/jteeuwen/go-bindata/BUILD +++ b/vendor/github.com/go-bindata/go-bindata/BUILD @@ -9,13 +9,14 @@ go_library( "convert.go", "debug.go", "doc.go", + "file.go", "release.go", "restore.go", "stringwriter.go", "toc.go", ], - importmap = "k8s.io/kubernetes/vendor/github.com/jteeuwen/go-bindata", - importpath = "github.com/jteeuwen/go-bindata", + importmap = "k8s.io/kubernetes/vendor/github.com/go-bindata/go-bindata", + importpath = "github.com/go-bindata/go-bindata", visibility = ["//visibility:public"], ) @@ -30,7 +31,7 @@ filegroup( name = "all-srcs", srcs = [ ":package-srcs", - "//vendor/github.com/jteeuwen/go-bindata/go-bindata:all-srcs", + "//vendor/github.com/go-bindata/go-bindata/go-bindata:all-srcs", ], tags = ["automanaged"], visibility = ["//visibility:public"], diff --git a/vendor/github.com/jteeuwen/go-bindata/CONTRIBUTING.md b/vendor/github.com/go-bindata/go-bindata/CONTRIBUTING.md similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/CONTRIBUTING.md rename to vendor/github.com/go-bindata/go-bindata/CONTRIBUTING.md diff --git a/vendor/github.com/jteeuwen/go-bindata/LICENSE b/vendor/github.com/go-bindata/go-bindata/LICENSE similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/LICENSE rename to vendor/github.com/go-bindata/go-bindata/LICENSE diff --git a/vendor/github.com/jteeuwen/go-bindata/Makefile b/vendor/github.com/go-bindata/go-bindata/Makefile similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/Makefile rename to vendor/github.com/go-bindata/go-bindata/Makefile diff --git a/vendor/github.com/jteeuwen/go-bindata/README.md b/vendor/github.com/go-bindata/go-bindata/README.md similarity index 97% rename from vendor/github.com/jteeuwen/go-bindata/README.md rename to vendor/github.com/go-bindata/go-bindata/README.md index bca57f72db3..e8c7e5bcb65 100644 --- a/vendor/github.com/jteeuwen/go-bindata/README.md +++ b/vendor/github.com/go-bindata/go-bindata/README.md @@ -1,5 +1,7 @@ ## bindata +[![Go Report Card](https://goreportcard.com/badge/github.com/go-bindata/bindata)](https://goreportcard.com/report/github.com/go-bindata/bindata) + This package converts any file into managable Go source code. Useful for embedding binary data into a go program. The file data is optionally gzip compressed before being converted to a raw byte slice. @@ -13,7 +15,7 @@ output being generated. To install the library and command line program, use the following: - go get -u github.com/jteeuwen/go-bindata/... + go get -u github.com/go-bindata/go-bindata/... ### Usage diff --git a/vendor/github.com/jteeuwen/go-bindata/asset.go b/vendor/github.com/go-bindata/go-bindata/asset.go similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/asset.go rename to vendor/github.com/go-bindata/go-bindata/asset.go diff --git a/vendor/github.com/jteeuwen/go-bindata/bytewriter.go b/vendor/github.com/go-bindata/go-bindata/bytewriter.go similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/bytewriter.go rename to vendor/github.com/go-bindata/go-bindata/bytewriter.go diff --git a/vendor/github.com/jteeuwen/go-bindata/config.go b/vendor/github.com/go-bindata/go-bindata/config.go similarity index 97% rename from vendor/github.com/jteeuwen/go-bindata/config.go rename to vendor/github.com/go-bindata/go-bindata/config.go index 2bd0d56d8c0..471c32f1b24 100644 --- a/vendor/github.com/jteeuwen/go-bindata/config.go +++ b/vendor/github.com/go-bindata/go-bindata/config.go @@ -106,6 +106,10 @@ type Config struct { // the file data when called. Defaults to false. NoCompress bool + // HttpFileSystem means whether generate return http.FileSystem interface + // instance's function.When true,will generate relate code. + HttpFileSystem bool + // Perform a debug build. This generates an asset file, which // loads the asset contents directly from disk at their original // location, instead of embedding the contents in the code. @@ -148,6 +152,7 @@ func NewConfig() *Config { c.Package = "main" c.NoMemCopy = false c.NoCompress = false + c.HttpFileSystem = false c.Debug = false c.Output = "./bindata.go" c.Ignore = make([]*regexp.Regexp, 0) diff --git a/vendor/github.com/jteeuwen/go-bindata/convert.go b/vendor/github.com/go-bindata/go-bindata/convert.go similarity index 95% rename from vendor/github.com/jteeuwen/go-bindata/convert.go rename to vendor/github.com/go-bindata/go-bindata/convert.go index cf0466edd12..06cc92d2ed1 100644 --- a/vendor/github.com/jteeuwen/go-bindata/convert.go +++ b/vendor/github.com/go-bindata/go-bindata/convert.go @@ -50,7 +50,7 @@ func Translate(c *Config) error { defer bfd.Flush() // Write the header. This makes e.g. Github ignore diffs in generated files. - if _, err = fmt.Fprint(bfd, "// Code generated by go-bindata.\n"); err != nil { + if _, err = fmt.Fprintf(bfd, "// Package %s Code generated by go-bindata. (@generated) DO NOT EDIT.\n", c.Package); err != nil { return err } if _, err = fmt.Fprint(bfd, "// sources:\n"); err != nil { @@ -68,9 +68,9 @@ func Translate(c *Config) error { return err } } - if _, err = fmt.Fprint(bfd, "// DO NOT EDIT!\n\n"); err != nil { - return err - } + //if _, err = fmt.Fprint(bfd, "// DO NOT EDIT!\n\n"); err != nil { + // return err + //} // Write build tags, if applicable. if len(c.Tags) > 0 { @@ -109,7 +109,7 @@ func Translate(c *Config) error { return writeRestore(bfd) } -// Implement sort.Interface for []os.FileInfo based on Name() +// ByName implements sort.Interface for []os.FileInfo based on Name() type ByName []os.FileInfo func (v ByName) Len() int { return len(v) } diff --git a/vendor/github.com/jteeuwen/go-bindata/debug.go b/vendor/github.com/go-bindata/go-bindata/debug.go similarity index 82% rename from vendor/github.com/jteeuwen/go-bindata/debug.go rename to vendor/github.com/go-bindata/go-bindata/debug.go index 09fee785d59..edb3270d6da 100644 --- a/vendor/github.com/jteeuwen/go-bindata/debug.go +++ b/vendor/github.com/go-bindata/go-bindata/debug.go @@ -11,7 +11,12 @@ import ( // writeDebug writes the debug code file. func writeDebug(w io.Writer, c *Config, toc []Asset) error { - err := writeDebugHeader(w) + err := writeDebugHeader(w, c) + if err != nil { + return err + } + + err = writeAssetFS(w, c) if err != nil { return err } @@ -28,13 +33,29 @@ func writeDebug(w io.Writer, c *Config, toc []Asset) error { // writeDebugHeader writes output file headers. // This targets debug builds. -func writeDebugHeader(w io.Writer) error { - _, err := fmt.Fprintf(w, `import ( +func writeDebugHeader(w io.Writer, c *Config) error { + var header string + + if c.HttpFileSystem { + header = `import ( + "bytes" + "net/http" "fmt" "io/ioutil" "os" "path/filepath" "strings" + "time"` + } else { + header = `import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings"` + } + + _, err := fmt.Fprintf(w, `%s ) // bindataRead reads the given file from disk. It returns an error on failure. @@ -51,7 +72,7 @@ type asset struct { info os.FileInfo } -`) +`, header) return err } diff --git a/vendor/github.com/jteeuwen/go-bindata/doc.go b/vendor/github.com/go-bindata/go-bindata/doc.go similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/doc.go rename to vendor/github.com/go-bindata/go-bindata/doc.go diff --git a/vendor/github.com/go-bindata/go-bindata/file.go b/vendor/github.com/go-bindata/go-bindata/file.go new file mode 100644 index 00000000000..8c83926c8ab --- /dev/null +++ b/vendor/github.com/go-bindata/go-bindata/file.go @@ -0,0 +1,102 @@ +package bindata + +import ( + "fmt" + "io" +) + +func writeAssetFS(w io.Writer, c *Config) error { + if !c.HttpFileSystem { + return nil + } + + _, err := fmt.Fprintf(w, ` +type assetFile struct { + *bytes.Reader + name string + childInfos []os.FileInfo + childInfoOffset int +} + +type assetOperator struct{} + +// Open implement http.FileSystem interface +func (f *assetOperator) Open(name string) (http.File, error) { + var err error + if len(name) > 0 && name[0] == '/' { + name = name[1:] + } + content, err := Asset(name) + if err == nil { + return &assetFile{name: name, Reader: bytes.NewReader(content)}, nil + } + children, err := AssetDir(name) + if err == nil { + childInfos := make([]os.FileInfo, 0, len(children)) + for _, child := range children { + childPath := filepath.Join(name, child) + info, errInfo := AssetInfo(filepath.Join(name, child)) + if errInfo == nil { + childInfos = append(childInfos, info) + } else { + childInfos = append(childInfos, newDirFileInfo(childPath)) + } + } + return &assetFile{name: name, childInfos: childInfos}, nil + } else { + // If the error is not found, return an error that will + // result in a 404 error. Otherwise the server returns + // a 500 error for files not found. + if strings.Contains(err.Error(), "not found") { + return nil, os.ErrNotExist + } + return nil, err + } +} + +// Close no need do anything +func (f *assetFile) Close() error { + return nil +} + +// Readdir read dir's children file info +func (f *assetFile) Readdir(count int) ([]os.FileInfo, error) { + if len(f.childInfos) == 0 { + return nil, os.ErrNotExist + } + if count <= 0 { + return f.childInfos, nil + } + if f.childInfoOffset+count > len(f.childInfos) { + count = len(f.childInfos) - f.childInfoOffset + } + offset := f.childInfoOffset + f.childInfoOffset += count + return f.childInfos[offset : offset+count], nil +} + +// Stat read file info from asset item +func (f *assetFile) Stat() (os.FileInfo, error) { + if len(f.childInfos) != 0 { + return newDirFileInfo(f.name), nil + } + return AssetInfo(f.name) +} + +// newDirFileInfo return default dir file info +func newDirFileInfo(name string) os.FileInfo { + return &bindataFileInfo{ + name: name, + size: 0, + mode: os.FileMode(2147484068), // equal os.FileMode(0644)|os.ModeDir + modTime: time.Time{}} +} + +// AssetFile return a http.FileSystem instance that data backend by asset +func AssetFile() http.FileSystem { + return &assetOperator{} +} + +`) + return err +} diff --git a/vendor/github.com/go-bindata/go-bindata/go-bindata/.gitignore b/vendor/github.com/go-bindata/go-bindata/go-bindata/.gitignore new file mode 100644 index 00000000000..099edf6f9f0 --- /dev/null +++ b/vendor/github.com/go-bindata/go-bindata/go-bindata/.gitignore @@ -0,0 +1 @@ +go-bindata diff --git a/vendor/github.com/jteeuwen/go-bindata/go-bindata/AppendSliceValue.go b/vendor/github.com/go-bindata/go-bindata/go-bindata/AppendSliceValue.go similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/go-bindata/AppendSliceValue.go rename to vendor/github.com/go-bindata/go-bindata/go-bindata/AppendSliceValue.go diff --git a/vendor/github.com/jteeuwen/go-bindata/go-bindata/BUILD b/vendor/github.com/go-bindata/go-bindata/go-bindata/BUILD similarity index 74% rename from vendor/github.com/jteeuwen/go-bindata/go-bindata/BUILD rename to vendor/github.com/go-bindata/go-bindata/go-bindata/BUILD index b6260250451..5ed33b4af48 100644 --- a/vendor/github.com/jteeuwen/go-bindata/go-bindata/BUILD +++ b/vendor/github.com/go-bindata/go-bindata/go-bindata/BUILD @@ -7,10 +7,10 @@ go_library( "main.go", "version.go", ], - importmap = "k8s.io/kubernetes/vendor/github.com/jteeuwen/go-bindata/go-bindata", - importpath = "github.com/jteeuwen/go-bindata/go-bindata", + importmap = "k8s.io/kubernetes/vendor/github.com/go-bindata/go-bindata/go-bindata", + importpath = "github.com/go-bindata/go-bindata/go-bindata", visibility = ["//visibility:private"], - deps = ["//vendor/github.com/jteeuwen/go-bindata:go_default_library"], + deps = ["//vendor/github.com/go-bindata/go-bindata:go_default_library"], ) go_binary( diff --git a/vendor/github.com/jteeuwen/go-bindata/go-bindata/main.go b/vendor/github.com/go-bindata/go-bindata/go-bindata/main.go similarity index 95% rename from vendor/github.com/jteeuwen/go-bindata/go-bindata/main.go rename to vendor/github.com/go-bindata/go-bindata/go-bindata/main.go index 503a059e618..f0155a5d035 100644 --- a/vendor/github.com/jteeuwen/go-bindata/go-bindata/main.go +++ b/vendor/github.com/go-bindata/go-bindata/go-bindata/main.go @@ -12,7 +12,7 @@ import ( "regexp" "strings" - "github.com/jteeuwen/go-bindata" + "github.com/go-bindata/go-bindata" ) func main() { @@ -48,6 +48,7 @@ func parseArgs() *bindata.Config { flag.BoolVar(&c.NoMemCopy, "nomemcopy", c.NoMemCopy, "Use a .rodata hack to get rid of unnecessary memcopies. Refer to the documentation to see what implications this carries.") flag.BoolVar(&c.NoCompress, "nocompress", c.NoCompress, "Assets will *not* be GZIP compressed when this flag is specified.") flag.BoolVar(&c.NoMetadata, "nometadata", c.NoMetadata, "Assets will not preserve size, mode, and modtime info.") + flag.BoolVar(&c.HttpFileSystem, "fs", c.HttpFileSystem, "Whether generate instance http.FileSystem interface code.") flag.UintVar(&c.Mode, "mode", c.Mode, "Optional file mode override for all files.") flag.Int64Var(&c.ModTime, "modtime", c.ModTime, "Optional modification unix timestamp override for all files.") flag.StringVar(&c.Output, "o", c.Output, "Optional name of the output file to be generated.") diff --git a/vendor/github.com/jteeuwen/go-bindata/go-bindata/version.go b/vendor/github.com/go-bindata/go-bindata/go-bindata/version.go similarity index 97% rename from vendor/github.com/jteeuwen/go-bindata/go-bindata/version.go rename to vendor/github.com/go-bindata/go-bindata/go-bindata/version.go index a12508ede93..eb47cfcf5a7 100644 --- a/vendor/github.com/jteeuwen/go-bindata/go-bindata/version.go +++ b/vendor/github.com/go-bindata/go-bindata/go-bindata/version.go @@ -23,7 +23,7 @@ var AppVersionRev string func Version() string { if len(AppVersionRev) == 0 { - AppVersionRev = "0" + AppVersionRev = "1" } return fmt.Sprintf("%s %d.%d.%s (Go runtime %s).\nCopyright (c) 2010-2013, Jim Teeuwen.", diff --git a/vendor/github.com/jteeuwen/go-bindata/release.go b/vendor/github.com/go-bindata/go-bindata/release.go similarity index 79% rename from vendor/github.com/jteeuwen/go-bindata/release.go rename to vendor/github.com/go-bindata/go-bindata/release.go index 6aefeb28acf..d1bef160f4a 100644 --- a/vendor/github.com/jteeuwen/go-bindata/release.go +++ b/vendor/github.com/go-bindata/go-bindata/release.go @@ -21,6 +21,11 @@ func writeRelease(w io.Writer, c *Config, toc []Asset) error { return err } + err = writeAssetFS(w, c) + if err != nil { + return err + } + for i := range toc { err = writeReleaseAsset(w, c, &toc[i]) if err != nil { @@ -37,15 +42,15 @@ func writeReleaseHeader(w io.Writer, c *Config) error { var err error if c.NoCompress { if c.NoMemCopy { - err = header_uncompressed_nomemcopy(w) + err = header_uncompressed_nomemcopy(w, c) } else { - err = header_uncompressed_memcopy(w) + err = header_uncompressed_memcopy(w, c) } } else { if c.NoMemCopy { - err = header_compressed_nomemcopy(w) + err = header_compressed_nomemcopy(w, c) } else { - err = header_compressed_memcopy(w) + err = header_compressed_memcopy(w, c) } } if err != nil { @@ -97,8 +102,23 @@ func sanitize(b []byte) []byte { return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1) } -func header_compressed_nomemcopy(w io.Writer) error { - _, err := fmt.Fprintf(w, `import ( +func header_compressed_nomemcopy(w io.Writer, c *Config) error { + var header string + + if c.HttpFileSystem { + header = `import ( + "bytes" + "compress/gzip" + "fmt" + "net/http" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time"` + } else { + header = `import ( "bytes" "compress/gzip" "fmt" @@ -107,7 +127,10 @@ func header_compressed_nomemcopy(w io.Writer) error { "os" "path/filepath" "strings" - "time" + "time"` + } + + _, err := fmt.Fprintf(w, `%s ) func bindataRead(data, name string) ([]byte, error) { @@ -130,12 +153,27 @@ func bindataRead(data, name string) ([]byte, error) { return buf.Bytes(), nil } -`) +`, header) return err } -func header_compressed_memcopy(w io.Writer) error { - _, err := fmt.Fprintf(w, `import ( +func header_compressed_memcopy(w io.Writer, c *Config) error { + var header string + + if c.HttpFileSystem { + header = `import ( + "bytes" + "compress/gzip" + "fmt" + "net/http" + "io" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time"` + } else { + header = `import ( "bytes" "compress/gzip" "fmt" @@ -144,7 +182,10 @@ func header_compressed_memcopy(w io.Writer) error { "os" "path/filepath" "strings" - "time" + "time"` + } + + _, err := fmt.Fprintf(w, `%s ) func bindataRead(data []byte, name string) ([]byte, error) { @@ -167,12 +208,27 @@ func bindataRead(data []byte, name string) ([]byte, error) { return buf.Bytes(), nil } -`) +`, header) return err } -func header_uncompressed_nomemcopy(w io.Writer) error { - _, err := fmt.Fprintf(w, `import ( +func header_uncompressed_nomemcopy(w io.Writer, c *Config) error { + var header string + + if c.HttpFileSystem { + header = `import ( + "bytes" + "fmt" + "net/http" + "io/ioutil" + "os" + "path/filepath" + "reflect" + "strings" + "time" + "unsafe"` + } else { + header = `import ( "fmt" "io/ioutil" "os" @@ -180,7 +236,10 @@ func header_uncompressed_nomemcopy(w io.Writer) error { "reflect" "strings" "time" - "unsafe" + "unsafe"` + } + + _, err := fmt.Fprintf(w, `%s ) func bindataRead(data, name string) ([]byte, error) { @@ -194,20 +253,36 @@ func bindataRead(data, name string) ([]byte, error) { return b, nil } -`) +`, header) return err } -func header_uncompressed_memcopy(w io.Writer) error { - _, err := fmt.Fprintf(w, `import ( +func header_uncompressed_memcopy(w io.Writer, c *Config) error { + var header string + + if c.HttpFileSystem { + header = `import ( + "bytes" + "fmt" + "net/http" + "io/ioutil" + "os" + "path/filepath" + "strings" + "time"` + } else { + header = `import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" - "time" + "time"` + } + + _, err := fmt.Fprintf(w, `%s ) -`) +`, header) return err } @@ -224,21 +299,32 @@ type bindataFileInfo struct { modTime time.Time } +// Name return file name func (fi bindataFileInfo) Name() string { return fi.name } + +// Size return file size func (fi bindataFileInfo) Size() int64 { return fi.size } + +// Mode return file mode func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } + +// Mode return file modify time func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } + +// IsDir return file whether a directory func (fi bindataFileInfo) IsDir() bool { - return false + return fi.mode&os.ModeDir != 0 } + +// Sys return file is sys mode func (fi bindataFileInfo) Sys() interface{} { return nil } diff --git a/vendor/github.com/jteeuwen/go-bindata/restore.go b/vendor/github.com/go-bindata/go-bindata/restore.go similarity index 99% rename from vendor/github.com/jteeuwen/go-bindata/restore.go rename to vendor/github.com/go-bindata/go-bindata/restore.go index 65db0e8f955..268ec7464e2 100644 --- a/vendor/github.com/jteeuwen/go-bindata/restore.go +++ b/vendor/github.com/go-bindata/go-bindata/restore.go @@ -57,7 +57,6 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } - `) return err } diff --git a/vendor/github.com/jteeuwen/go-bindata/stringwriter.go b/vendor/github.com/go-bindata/go-bindata/stringwriter.go similarity index 100% rename from vendor/github.com/jteeuwen/go-bindata/stringwriter.go rename to vendor/github.com/go-bindata/go-bindata/stringwriter.go diff --git a/vendor/github.com/jteeuwen/go-bindata/toc.go b/vendor/github.com/go-bindata/go-bindata/toc.go similarity index 78% rename from vendor/github.com/jteeuwen/go-bindata/toc.go rename to vendor/github.com/go-bindata/go-bindata/toc.go index 9ec410b2568..be4a01654b5 100644 --- a/vendor/github.com/jteeuwen/go-bindata/toc.go +++ b/vendor/github.com/go-bindata/go-bindata/toc.go @@ -52,6 +52,40 @@ func (root *assetTree) funcOrNil() string { } } +func getFillerSize(tokenIndex int, lengths []int, nident int) int { + var ( + curlen int = lengths[tokenIndex] + maxlen int = 0 + substart int = 0 + subend int = 0 + spacediff int = 0 + ) + + if curlen > 0 { + substart = tokenIndex + for (substart-1) >= 0 && lengths[substart-1] > 0 { + substart -= 1 + } + + subend = tokenIndex + for (subend+1) < len(lengths) && lengths[subend+1] > 0 { + subend += 1 + } + + var candidate int + for j := substart; j <= subend; j += 1 { + candidate = lengths[j] + if candidate > maxlen { + maxlen = candidate + } + } + + spacediff = maxlen - curlen + } + + return spacediff +} + func (root *assetTree) writeGoMap(w io.Writer, nident int) { fmt.Fprintf(w, "&bintree{%s, map[string]*bintree{", root.funcOrNil()) @@ -60,16 +94,28 @@ func (root *assetTree) writeGoMap(w io.Writer, nident int) { // Sort to make output stable between invocations filenames := make([]string, len(root.Children)) + hasChildren := make(map[string]bool) i := 0 - for filename, _ := range root.Children { + for filename, node := range root.Children { filenames[i] = filename + hasChildren[filename] = len(node.Children) > 0 i++ } sort.Strings(filenames) - for _, p := range filenames { + lengths := make([]int, len(root.Children)) + for i, filename := range filenames { + if hasChildren[filename] { + lengths[i] = 0 + } else { + lengths[i] = len(filename) + } + } + + for i, p := range filenames { ident(w, nident+1) - fmt.Fprintf(w, `"%s": `, p) + filler := strings.Repeat(" ", getFillerSize(i, lengths, nident)) + fmt.Fprintf(w, `"%s": %s`, p, filler) root.Children[p].writeGoMap(w, nident+1) } ident(w, nident) @@ -87,6 +133,7 @@ func (root *assetTree) WriteAsGoMap(w io.Writer) error { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = `) root.writeGoMap(w, 0) return err @@ -147,8 +194,16 @@ func writeTOC(w io.Writer, toc []Asset) error { return err } + var maxlen = 0 for i := range toc { - err = writeTOCAsset(w, &toc[i]) + l := len(toc[i].Name) + if l > maxlen { + maxlen = l + } + } + + for i := range toc { + err = writeTOCAsset(w, &toc[i], maxlen) if err != nil { return err } @@ -216,8 +271,11 @@ var _bindata = map[string]func() (*asset, error){ } // writeTOCAsset write a TOC entry for the given asset. -func writeTOCAsset(w io.Writer, asset *Asset) error { - _, err := fmt.Fprintf(w, "\t%q: %s,\n", asset.Name, asset.Func) +func writeTOCAsset(w io.Writer, asset *Asset, maxlen int) error { + spacediff := maxlen - len(asset.Name) + filler := strings.Repeat(" ", spacediff) + + _, err := fmt.Fprintf(w, "\t%q: %s%s,\n", asset.Name, filler, asset.Func) return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index c77283b2dd0..65a5b8a764c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -342,6 +342,9 @@ github.com/ghodss/yaml # github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 => github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 github.com/globalsign/mgo/bson github.com/globalsign/mgo/internal/json +# github.com/go-bindata/go-bindata v3.1.1+incompatible => github.com/go-bindata/go-bindata v3.1.1+incompatible +github.com/go-bindata/go-bindata +github.com/go-bindata/go-bindata/go-bindata # github.com/go-openapi/analysis v0.17.2 => github.com/go-openapi/analysis v0.17.2 github.com/go-openapi/analysis github.com/go-openapi/analysis/internal @@ -558,9 +561,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/jteeuwen/go-bindata v0.0.0-20151023091102-a0ff2567cfb7 => github.com/jteeuwen/go-bindata v0.0.0-20151023091102-a0ff2567cfb7 -github.com/jteeuwen/go-bindata -github.com/jteeuwen/go-bindata/go-bindata # 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