Update godeps

This commit is contained in:
Manuel de Brito Fontes 2016-11-10 19:57:28 -03:00
parent 1c8773fc98
commit 1bc383f9c5
1723 changed files with 287976 additions and 411028 deletions

29
vendor/k8s.io/kubernetes/pkg/util/yaml/BUILD generated vendored Normal file
View file

@ -0,0 +1,29 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
"go_test",
"cgo_library",
)
go_library(
name = "go_default_library",
srcs = ["decoder.go"],
tags = ["automanaged"],
deps = [
"//vendor:github.com/ghodss/yaml",
"//vendor:github.com/golang/glog",
],
)
go_test(
name = "go_default_test",
srcs = ["decoder_test.go"],
library = "go_default_library",
tags = ["automanaged"],
deps = [],
)

View file

@ -137,7 +137,7 @@ func (d *YAMLDecoder) Close() error {
}
const yamlSeparator = "\n---"
const separator = "---\n"
const separator = "---"
// splitYAMLDocument is a bufio.SplitFunc for splitting YAML streams into individual documents.
func splitYAMLDocument(data []byte, atEOF bool) (advance int, token []byte, err error) {
@ -246,16 +246,28 @@ func (r *YAMLReader) Read() ([]byte, error) {
return nil, err
}
if string(line) == separator || err == io.EOF {
sep := len([]byte(separator))
if i := bytes.Index(line, []byte(separator)); i == 0 {
// We have a potential document terminator
i += sep
after := line[i:]
if len(strings.TrimRightFunc(string(after), unicode.IsSpace)) == 0 {
if buffer.Len() != 0 {
return buffer.Bytes(), nil
}
if err == io.EOF {
return nil, err
}
}
}
if err == io.EOF {
if buffer.Len() != 0 {
// If we're at EOF, we have a final, non-terminated line. Return it.
return buffer.Bytes(), nil
}
if err == io.EOF {
return nil, err
}
} else {
buffer.Write(line)
return nil, err
}
buffer.Write(line)
}
}