Bumping k8s dependencies to 1.13
This commit is contained in:
2
vendor/gopkg.in/yaml.v2/README.md
generated
vendored
2
vendor/gopkg.in/yaml.v2/README.md
generated
vendored
@@ -48,8 +48,6 @@ The yaml package is licensed under the Apache License 2.0. Please see the LICENS
|
||||
Example
|
||||
-------
|
||||
|
||||
Some more examples can be found in the "examples" folder.
|
||||
|
||||
```Go
|
||||
package main
|
||||
|
||||
|
2
vendor/gopkg.in/yaml.v2/apic.go
generated
vendored
2
vendor/gopkg.in/yaml.v2/apic.go
generated
vendored
@@ -468,7 +468,7 @@ func yaml_event_delete(event *yaml_event_t) {
|
||||
// } context
|
||||
// tag_directive *yaml_tag_directive_t
|
||||
//
|
||||
// context.error = YAML_NO_ERROR // Eliminate a compliler warning.
|
||||
// context.error = YAML_NO_ERROR // Eliminate a compiler warning.
|
||||
//
|
||||
// assert(document) // Non-NULL document object is expected.
|
||||
//
|
||||
|
13
vendor/gopkg.in/yaml.v2/decode.go
generated
vendored
13
vendor/gopkg.in/yaml.v2/decode.go
generated
vendored
@@ -113,6 +113,10 @@ func (p *parser) fail() {
|
||||
var line int
|
||||
if p.parser.problem_mark.line != 0 {
|
||||
line = p.parser.problem_mark.line
|
||||
// Scanner errors don't iterate line before returning error
|
||||
if p.parser.error == yaml_SCANNER_ERROR {
|
||||
line++
|
||||
}
|
||||
} else if p.parser.context_mark.line != 0 {
|
||||
line = p.parser.context_mark.line
|
||||
}
|
||||
@@ -430,6 +434,7 @@ func (d *decoder) scalar(n *node, out reflect.Value) bool {
|
||||
// reasons we set it as a string, so that code that unmarshals
|
||||
// timestamp-like values into interface{} will continue to
|
||||
// see a string and not a time.Time.
|
||||
// TODO(v3) Drop this.
|
||||
out.Set(reflect.ValueOf(n.value))
|
||||
} else {
|
||||
out.Set(reflect.ValueOf(resolved))
|
||||
@@ -542,6 +547,10 @@ func (d *decoder) sequence(n *node, out reflect.Value) (good bool) {
|
||||
switch out.Kind() {
|
||||
case reflect.Slice:
|
||||
out.Set(reflect.MakeSlice(out.Type(), l, l))
|
||||
case reflect.Array:
|
||||
if l != out.Len() {
|
||||
failf("invalid array: want %d elements but got %d", out.Len(), l)
|
||||
}
|
||||
case reflect.Interface:
|
||||
// No type hints. Will have to use a generic sequence.
|
||||
iface = out
|
||||
@@ -560,7 +569,9 @@ func (d *decoder) sequence(n *node, out reflect.Value) (good bool) {
|
||||
j++
|
||||
}
|
||||
}
|
||||
out.Set(out.Slice(0, j))
|
||||
if out.Kind() != reflect.Array {
|
||||
out.Set(out.Slice(0, j))
|
||||
}
|
||||
if iface.IsValid() {
|
||||
iface.Set(out)
|
||||
}
|
||||
|
54
vendor/gopkg.in/yaml.v2/decode_test.go
generated
vendored
54
vendor/gopkg.in/yaml.v2/decode_test.go
generated
vendored
@@ -129,6 +129,9 @@ var unmarshalTests = []struct {
|
||||
}, {
|
||||
"bin: -0b101010",
|
||||
map[string]interface{}{"bin": -42},
|
||||
}, {
|
||||
"bin: -0b1000000000000000000000000000000000000000000000000000000000000000",
|
||||
map[string]interface{}{"bin": -9223372036854775808},
|
||||
}, {
|
||||
"decimal: +685_230",
|
||||
map[string]int{"decimal": 685230},
|
||||
@@ -241,6 +244,9 @@ var unmarshalTests = []struct {
|
||||
}, {
|
||||
"a: [1, 2]",
|
||||
&struct{ A []int }{[]int{1, 2}},
|
||||
}, {
|
||||
"a: [1, 2]",
|
||||
&struct{ A [2]int }{[2]int{1, 2}},
|
||||
}, {
|
||||
"a: 1",
|
||||
&struct{ B int }{0},
|
||||
@@ -399,6 +405,12 @@ var unmarshalTests = []struct {
|
||||
{
|
||||
"v: !!float '1.1'",
|
||||
map[string]interface{}{"v": 1.1},
|
||||
}, {
|
||||
"v: !!float 0",
|
||||
map[string]interface{}{"v": float64(0)},
|
||||
}, {
|
||||
"v: !!float -1",
|
||||
map[string]interface{}{"v": float64(-1)},
|
||||
}, {
|
||||
"v: !!null ''",
|
||||
map[string]interface{}{"v": nil},
|
||||
@@ -728,6 +740,18 @@ func (s *S) TestUnmarshal(c *C) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(v3): This test should also work when unmarshaling onto an interface{}.
|
||||
func (s *S) TestUnmarshalFullTimestamp(c *C) {
|
||||
// Full timestamp in same format as encoded. This is confirmed to be
|
||||
// properly decoded by Python as a timestamp as well.
|
||||
var str = "2015-02-24T18:19:39.123456789-03:00"
|
||||
var t time.Time
|
||||
err := yaml.Unmarshal([]byte(str), &t)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(t, Equals, time.Date(2015, 2, 24, 18, 19, 39, 123456789, t.Location()))
|
||||
c.Assert(t.In(time.UTC), Equals, time.Date(2015, 2, 24, 21, 19, 39, 123456789, time.UTC))
|
||||
}
|
||||
|
||||
func (s *S) TestDecoderSingleDocument(c *C) {
|
||||
// Test that Decoder.Decode works as expected on
|
||||
// all the unmarshal tests.
|
||||
@@ -813,6 +837,7 @@ var unmarshalErrorTests = []struct {
|
||||
{"v: !!float 'error'", "yaml: cannot decode !!str `error` as a !!float"},
|
||||
{"v: [A,", "yaml: line 1: did not find expected node content"},
|
||||
{"v:\n- [A,", "yaml: line 2: did not find expected node content"},
|
||||
{"a:\n- b: *,", "yaml: line 2: did not find expected alphabetic or numeric character"},
|
||||
{"a: *b\n", "yaml: unknown anchor 'b' referenced"},
|
||||
{"a: &a\n b: *a\n", "yaml: anchor 'a' value contains itself"},
|
||||
{"value: -", "yaml: block sequence entries are not allowed in this context"},
|
||||
@@ -1242,6 +1267,35 @@ func (t *textUnmarshaler) UnmarshalText(s []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *S) TestFuzzCrashers(c *C) {
|
||||
cases := []string{
|
||||
// runtime error: index out of range
|
||||
"\"\\0\\\r\n",
|
||||
|
||||
// should not happen
|
||||
" 0: [\n] 0",
|
||||
"? ? \"\n\" 0",
|
||||
" - {\n000}0",
|
||||
"0:\n 0: [0\n] 0",
|
||||
" - \"\n000\"0",
|
||||
" - \"\n000\"\"",
|
||||
"0:\n - {\n000}0",
|
||||
"0:\n - \"\n000\"0",
|
||||
"0:\n - \"\n000\"\"",
|
||||
|
||||
// runtime error: index out of range
|
||||
" \ufeff\n",
|
||||
"? \ufeff\n",
|
||||
"? \ufeff:\n",
|
||||
"0: \ufeff\n",
|
||||
"? \ufeff: \ufeff\n",
|
||||
}
|
||||
for _, data := range cases {
|
||||
var v interface{}
|
||||
_ = yaml.Unmarshal([]byte(data), &v)
|
||||
}
|
||||
}
|
||||
|
||||
//var data []byte
|
||||
//func init() {
|
||||
// var err error
|
||||
|
2
vendor/gopkg.in/yaml.v2/emitterc.go
generated
vendored
2
vendor/gopkg.in/yaml.v2/emitterc.go
generated
vendored
@@ -843,7 +843,7 @@ func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event
|
||||
return true
|
||||
}
|
||||
|
||||
// Write an achor.
|
||||
// Write an anchor.
|
||||
func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool {
|
||||
if emitter.anchor_data.anchor == nil {
|
||||
return true
|
||||
|
16
vendor/gopkg.in/yaml.v2/encode.go
generated
vendored
16
vendor/gopkg.in/yaml.v2/encode.go
generated
vendored
@@ -131,7 +131,7 @@ func (e *encoder) marshal(tag string, in reflect.Value) {
|
||||
} else {
|
||||
e.structv(tag, in)
|
||||
}
|
||||
case reflect.Slice:
|
||||
case reflect.Slice, reflect.Array:
|
||||
if in.Type().Elem() == mapItemType {
|
||||
e.itemsv(tag, in)
|
||||
} else {
|
||||
@@ -328,14 +328,18 @@ func (e *encoder) uintv(tag string, in reflect.Value) {
|
||||
|
||||
func (e *encoder) timev(tag string, in reflect.Value) {
|
||||
t := in.Interface().(time.Time)
|
||||
if tag == "" {
|
||||
tag = yaml_TIMESTAMP_TAG
|
||||
}
|
||||
e.emitScalar(t.Format(time.RFC3339Nano), "", tag, yaml_PLAIN_SCALAR_STYLE)
|
||||
s := t.Format(time.RFC3339Nano)
|
||||
e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE)
|
||||
}
|
||||
|
||||
func (e *encoder) floatv(tag string, in reflect.Value) {
|
||||
s := strconv.FormatFloat(in.Float(), 'g', -1, 64)
|
||||
// Issue #352: When formatting, use the precision of the underlying value
|
||||
precision := 64
|
||||
if in.Kind() == reflect.Float32 {
|
||||
precision = 32
|
||||
}
|
||||
|
||||
s := strconv.FormatFloat(in.Float(), 'g', -1, precision)
|
||||
switch s {
|
||||
case "+Inf":
|
||||
s = ".inf"
|
||||
|
26
vendor/gopkg.in/yaml.v2/encode_test.go
generated
vendored
26
vendor/gopkg.in/yaml.v2/encode_test.go
generated
vendored
@@ -75,6 +75,9 @@ var marshalTests = []struct {
|
||||
}, {
|
||||
map[string]interface{}{"v": float64(0.1)},
|
||||
"v: 0.1\n",
|
||||
}, {
|
||||
map[string]interface{}{"v": float32(0.99)},
|
||||
"v: 0.99\n",
|
||||
}, {
|
||||
map[string]interface{}{"v": -0.1},
|
||||
"v: -0.1\n",
|
||||
@@ -147,6 +150,9 @@ var marshalTests = []struct {
|
||||
}, {
|
||||
&struct{ A []int }{[]int{1, 2}},
|
||||
"a:\n- 1\n- 2\n",
|
||||
}, {
|
||||
&struct{ A [2]int }{[2]int{1, 2}},
|
||||
"a:\n- 1\n- 2\n",
|
||||
}, {
|
||||
&struct {
|
||||
B int "a"
|
||||
@@ -212,7 +218,7 @@ var marshalTests = []struct {
|
||||
T2: time.Date(2018, 1, 9, 10, 40, 47, 0, time.UTC),
|
||||
T4: newTime(time.Date(2098, 1, 9, 10, 40, 47, 0, time.UTC)),
|
||||
},
|
||||
"t2: !!timestamp 2018-01-09T10:40:47Z\nt4: !!timestamp 2098-01-09T10:40:47Z\n",
|
||||
"t2: 2018-01-09T10:40:47Z\nt4: 2098-01-09T10:40:47Z\n",
|
||||
},
|
||||
// Nil interface that implements Marshaler.
|
||||
{
|
||||
@@ -329,11 +335,16 @@ var marshalTests = []struct {
|
||||
// time.Time gets a timestamp tag.
|
||||
{
|
||||
map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, 0, time.UTC)},
|
||||
"a: !!timestamp 2015-02-24T18:19:39Z\n",
|
||||
"a: 2015-02-24T18:19:39Z\n",
|
||||
},
|
||||
{
|
||||
map[string]*time.Time{"a": newTime(time.Date(2015, 2, 24, 18, 19, 39, 0, time.UTC))},
|
||||
"a: !!timestamp 2015-02-24T18:19:39Z\n",
|
||||
"a: 2015-02-24T18:19:39Z\n",
|
||||
},
|
||||
{
|
||||
// This is confirmed to be properly decoded in Python (libyaml) without a timestamp tag.
|
||||
map[string]time.Time{"a": time.Date(2015, 2, 24, 18, 19, 39, 123456789, time.FixedZone("FOO", -3*60*60))},
|
||||
"a: 2015-02-24T18:19:39.123456789-03:00\n",
|
||||
},
|
||||
// Ensure timestamp-like strings are quoted.
|
||||
{
|
||||
@@ -527,8 +538,13 @@ func (s *S) TestSortedOutput(c *C) {
|
||||
"1",
|
||||
"2",
|
||||
"a!10",
|
||||
"a/2",
|
||||
"a/0001",
|
||||
"a/002",
|
||||
"a/3",
|
||||
"a/10",
|
||||
"a/11",
|
||||
"a/0012",
|
||||
"a/100",
|
||||
"a~10",
|
||||
"ab/1",
|
||||
"b/1",
|
||||
@@ -543,6 +559,8 @@ func (s *S) TestSortedOutput(c *C) {
|
||||
"c2.10",
|
||||
"c10.2",
|
||||
"d1",
|
||||
"d7",
|
||||
"d7abc",
|
||||
"d12",
|
||||
"d12a",
|
||||
}
|
||||
|
20
vendor/gopkg.in/yaml.v2/readerc.go
generated
vendored
20
vendor/gopkg.in/yaml.v2/readerc.go
generated
vendored
@@ -93,9 +93,18 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {
|
||||
panic("read handler must be set")
|
||||
}
|
||||
|
||||
// [Go] This function was changed to guarantee the requested length size at EOF.
|
||||
// The fact we need to do this is pretty awful, but the description above implies
|
||||
// for that to be the case, and there are tests
|
||||
|
||||
// If the EOF flag is set and the raw buffer is empty, do nothing.
|
||||
if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) {
|
||||
return true
|
||||
// [Go] ACTUALLY! Read the documentation of this function above.
|
||||
// This is just broken. To return true, we need to have the
|
||||
// given length in the buffer. Not doing that means every single
|
||||
// check that calls this function to make sure the buffer has a
|
||||
// given length is Go) panicking; or C) accessing invalid memory.
|
||||
//return true
|
||||
}
|
||||
|
||||
// Return if the buffer contains enough characters.
|
||||
@@ -389,6 +398,15 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool {
|
||||
break
|
||||
}
|
||||
}
|
||||
// [Go] Read the documentation of this function above. To return true,
|
||||
// we need to have the given length in the buffer. Not doing that means
|
||||
// every single check that calls this function to make sure the buffer
|
||||
// has a given length is Go) panicking; or C) accessing invalid memory.
|
||||
// This happens here due to the EOF above breaking early.
|
||||
for buffer_len < length {
|
||||
parser.buffer[buffer_len] = 0
|
||||
buffer_len++
|
||||
}
|
||||
parser.buffer = parser.buffer[:buffer_len]
|
||||
return true
|
||||
}
|
||||
|
29
vendor/gopkg.in/yaml.v2/resolve.go
generated
vendored
29
vendor/gopkg.in/yaml.v2/resolve.go
generated
vendored
@@ -92,6 +92,19 @@ func resolve(tag string, in string) (rtag string, out interface{}) {
|
||||
switch tag {
|
||||
case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG:
|
||||
return
|
||||
case yaml_FLOAT_TAG:
|
||||
if rtag == yaml_INT_TAG {
|
||||
switch v := out.(type) {
|
||||
case int64:
|
||||
rtag = yaml_FLOAT_TAG
|
||||
out = float64(v)
|
||||
return
|
||||
case int:
|
||||
rtag = yaml_FLOAT_TAG
|
||||
out = float64(v)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag))
|
||||
}()
|
||||
@@ -167,12 +180,12 @@ func resolve(tag string, in string) (rtag string, out interface{}) {
|
||||
return yaml_INT_TAG, uintv
|
||||
}
|
||||
} else if strings.HasPrefix(plain, "-0b") {
|
||||
intv, err := strconv.ParseInt(plain[3:], 2, 64)
|
||||
intv, err := strconv.ParseInt("-" + plain[3:], 2, 64)
|
||||
if err == nil {
|
||||
if intv == int64(int(intv)) {
|
||||
return yaml_INT_TAG, -int(intv)
|
||||
if true || intv == int64(int(intv)) {
|
||||
return yaml_INT_TAG, int(intv)
|
||||
} else {
|
||||
return yaml_INT_TAG, -intv
|
||||
return yaml_INT_TAG, intv
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,10 +224,10 @@ func encodeBase64(s string) string {
|
||||
// This is a subset of the formats allowed by the regular expression
|
||||
// defined at http://yaml.org/type/timestamp.html.
|
||||
var allowedTimestampFormats = []string{
|
||||
"2006-1-2T15:4:5Z07:00",
|
||||
"2006-1-2t15:4:5Z07:00", // RFC3339 with lower-case "t".
|
||||
"2006-1-2 15:4:5", // space separated with no time zone
|
||||
"2006-1-2", // date only
|
||||
"2006-1-2T15:4:5.999999999Z07:00", // RCF3339Nano with short date fields.
|
||||
"2006-1-2t15:4:5.999999999Z07:00", // RFC3339Nano with short date fields and lower-case "t".
|
||||
"2006-1-2 15:4:5.999999999", // space separated with no time zone
|
||||
"2006-1-2", // date only
|
||||
// Notable exception: time.Parse cannot handle: "2001-12-14 21:59:43.10 -5"
|
||||
// from the set of examples.
|
||||
}
|
||||
|
18
vendor/gopkg.in/yaml.v2/scannerc.go
generated
vendored
18
vendor/gopkg.in/yaml.v2/scannerc.go
generated
vendored
@@ -871,12 +871,6 @@ func yaml_parser_save_simple_key(parser *yaml_parser_t) bool {
|
||||
|
||||
required := parser.flow_level == 0 && parser.indent == parser.mark.column
|
||||
|
||||
// A simple key is required only when it is the first token in the current
|
||||
// line. Therefore it is always allowed. But we add a check anyway.
|
||||
if required && !parser.simple_key_allowed {
|
||||
panic("should not happen")
|
||||
}
|
||||
|
||||
//
|
||||
// If the current position may start a simple key, save it.
|
||||
//
|
||||
@@ -2475,6 +2469,10 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si
|
||||
}
|
||||
}
|
||||
|
||||
if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if we are at the end of the scalar.
|
||||
if single {
|
||||
if parser.buffer[parser.buffer_pos] == '\'' {
|
||||
@@ -2487,10 +2485,6 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si
|
||||
}
|
||||
|
||||
// Consume blank characters.
|
||||
if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {
|
||||
if is_blank(parser.buffer, parser.buffer_pos) {
|
||||
// Consume a space or a tab character.
|
||||
@@ -2647,10 +2641,10 @@ func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) b
|
||||
for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) {
|
||||
if is_blank(parser.buffer, parser.buffer_pos) {
|
||||
|
||||
// Check for tab character that abuse indentation.
|
||||
// Check for tab characters that abuse indentation.
|
||||
if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) {
|
||||
yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
|
||||
start_mark, "found a tab character that violate indentation")
|
||||
start_mark, "found a tab character that violates indentation")
|
||||
return false
|
||||
}
|
||||
|
||||
|
9
vendor/gopkg.in/yaml.v2/sorter.go
generated
vendored
9
vendor/gopkg.in/yaml.v2/sorter.go
generated
vendored
@@ -51,6 +51,15 @@ func (l keyList) Less(i, j int) bool {
|
||||
}
|
||||
var ai, bi int
|
||||
var an, bn int64
|
||||
if ar[i] == '0' || br[i] == '0' {
|
||||
for j := i-1; j >= 0 && unicode.IsDigit(ar[j]); j-- {
|
||||
if ar[j] != '0' {
|
||||
an = 1
|
||||
bn = 1
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ {
|
||||
an = an*10 + int64(ar[ai]-'0')
|
||||
}
|
||||
|
4
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
4
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
@@ -157,8 +157,8 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) {
|
||||
// of the generated document will reflect the structure of the value itself.
|
||||
// Maps and pointers (to struct, string, int, etc) are accepted as the in value.
|
||||
//
|
||||
// Struct fields are only unmarshalled if they are exported (have an upper case
|
||||
// first letter), and are unmarshalled using the field name lowercased as the
|
||||
// Struct fields are only marshalled if they are exported (have an upper case
|
||||
// first letter), and are marshalled using the field name lowercased as the
|
||||
// default key. Custom keys may be defined via the "yaml" name in the field
|
||||
// tag: the content preceding the first comma is used as the key, and the
|
||||
// following comma-separated options are used to tweak the marshalling process.
|
||||
|
Reference in New Issue
Block a user