run update-vendor.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2020-03-10 14:02:15 -04:00
parent 0c52ffe08f
commit 825f99c396
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59
7 changed files with 0 additions and 201 deletions

View File

@ -10,7 +10,6 @@ go_library(
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/cri-api/pkg/apis:go_default_library",
"//staging/src/k8s.io/cri-api/pkg/apis/runtime/v1alpha2:go_default_library",
"//vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog:go_default_library",
"//vendor/github.com/fsnotify/fsnotify:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
],

1
vendor/BUILD vendored
View File

@ -112,7 +112,6 @@ filegroup(
"//vendor/github.com/docker/distribution/registry/api/errcode:all-srcs",
"//vendor/github.com/docker/docker/api:all-srcs",
"//vendor/github.com/docker/docker/client:all-srcs",
"//vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog:all-srcs",
"//vendor/github.com/docker/docker/errdefs:all-srcs",
"//vendor/github.com/docker/docker/pkg/jsonmessage:all-srcs",
"//vendor/github.com/docker/docker/pkg/mount:all-srcs",

View File

@ -1,28 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"jsonlog.go",
"jsonlogbytes.go",
"time_marshalling.go",
],
importmap = "k8s.io/kubernetes/vendor/github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog",
importpath = "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog",
visibility = ["//visibility:public"],
deps = ["//vendor/github.com/pkg/errors:go_default_library"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -1,25 +0,0 @@
package jsonlog // import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog"
import (
"time"
)
// JSONLog is a log message, typically a single entry from a given log stream.
type JSONLog struct {
// Log is the log message
Log string `json:"log,omitempty"`
// Stream is the log source
Stream string `json:"stream,omitempty"`
// Created is the created timestamp of log
Created time.Time `json:"time"`
// Attrs is the list of extra attributes provided by the user
Attrs map[string]string `json:"attrs,omitempty"`
}
// Reset all fields to their zero value.
func (jl *JSONLog) Reset() {
jl.Log = ""
jl.Stream = ""
jl.Created = time.Time{}
jl.Attrs = make(map[string]string)
}

View File

@ -1,125 +0,0 @@
package jsonlog // import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog"
import (
"bytes"
"encoding/json"
"time"
"unicode/utf8"
)
// JSONLogs marshals encoded JSONLog objects
type JSONLogs struct {
Log []byte `json:"log,omitempty"`
Stream string `json:"stream,omitempty"`
Created time.Time `json:"time"`
// json-encoded bytes
RawAttrs json.RawMessage `json:"attrs,omitempty"`
}
// MarshalJSONBuf is an optimized JSON marshaller that avoids reflection
// and unnecessary allocation.
func (mj *JSONLogs) MarshalJSONBuf(buf *bytes.Buffer) error {
var first = true
buf.WriteString(`{`)
if len(mj.Log) != 0 {
first = false
buf.WriteString(`"log":`)
ffjsonWriteJSONBytesAsString(buf, mj.Log)
}
if len(mj.Stream) != 0 {
if first {
first = false
} else {
buf.WriteString(`,`)
}
buf.WriteString(`"stream":`)
ffjsonWriteJSONBytesAsString(buf, []byte(mj.Stream))
}
if len(mj.RawAttrs) > 0 {
if first {
first = false
} else {
buf.WriteString(`,`)
}
buf.WriteString(`"attrs":`)
buf.Write(mj.RawAttrs)
}
if !first {
buf.WriteString(`,`)
}
created, err := fastTimeMarshalJSON(mj.Created)
if err != nil {
return err
}
buf.WriteString(`"time":`)
buf.WriteString(created)
buf.WriteString(`}`)
return nil
}
func ffjsonWriteJSONBytesAsString(buf *bytes.Buffer, s []byte) {
const hex = "0123456789abcdef"
buf.WriteByte('"')
start := 0
for i := 0; i < len(s); {
if b := s[i]; b < utf8.RuneSelf {
if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' {
i++
continue
}
if start < i {
buf.Write(s[start:i])
}
switch b {
case '\\', '"':
buf.WriteByte('\\')
buf.WriteByte(b)
case '\n':
buf.WriteByte('\\')
buf.WriteByte('n')
case '\r':
buf.WriteByte('\\')
buf.WriteByte('r')
default:
buf.WriteString(`\u00`)
buf.WriteByte(hex[b>>4])
buf.WriteByte(hex[b&0xF])
}
i++
start = i
continue
}
c, size := utf8.DecodeRune(s[i:])
if c == utf8.RuneError && size == 1 {
if start < i {
buf.Write(s[start:i])
}
buf.WriteString(`\ufffd`)
i += size
start = i
continue
}
if c == '\u2028' || c == '\u2029' {
if start < i {
buf.Write(s[start:i])
}
buf.WriteString(`\u202`)
buf.WriteByte(hex[c&0xF])
i += size
start = i
continue
}
i += size
}
if start < len(s) {
buf.Write(s[start:])
}
buf.WriteByte('"')
}

View File

@ -1,20 +0,0 @@
package jsonlog // import "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog"
import (
"time"
"github.com/pkg/errors"
)
const jsonFormat = `"` + time.RFC3339Nano + `"`
// fastTimeMarshalJSON avoids one of the extra allocations that
// time.MarshalJSON is making.
func fastTimeMarshalJSON(t time.Time) (string, error) {
if y := t.Year(); y < 0 || y >= 10000 {
// RFC 3339 is clear that years are 4 digits exactly.
// See golang.org/issue/4556#c15 for more discussion.
return "", errors.New("time.MarshalJSON: year outside of range [0,9999]")
}
return t.Format(jsonFormat), nil
}

1
vendor/modules.txt vendored
View File

@ -233,7 +233,6 @@ github.com/docker/docker/api/types/time
github.com/docker/docker/api/types/versions
github.com/docker/docker/api/types/volume
github.com/docker/docker/client
github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog
github.com/docker/docker/errdefs
github.com/docker/docker/pkg/jsonmessage
github.com/docker/docker/pkg/mount