Update hcsshim to v0.8.9
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
27
vendor/github.com/Microsoft/hcsshim/internal/log/BUILD
generated
vendored
Normal file
27
vendor/github.com/Microsoft/hcsshim/internal/log/BUILD
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["g.go"],
|
||||
importmap = "k8s.io/kubernetes/vendor/github.com/Microsoft/hcsshim/internal/log",
|
||||
importpath = "github.com/Microsoft/hcsshim/internal/log",
|
||||
visibility = ["//vendor/github.com/Microsoft/hcsshim:__subpackages__"],
|
||||
deps = [
|
||||
"//vendor/github.com/sirupsen/logrus:go_default_library",
|
||||
"//vendor/go.opencensus.io/trace: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"],
|
||||
)
|
23
vendor/github.com/Microsoft/hcsshim/internal/log/g.go
generated
vendored
Normal file
23
vendor/github.com/Microsoft/hcsshim/internal/log/g.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
// G returns a `logrus.Entry` with the `TraceID, SpanID` from `ctx` if `ctx`
|
||||
// contains an OpenCensus `trace.Span`.
|
||||
func G(ctx context.Context) *logrus.Entry {
|
||||
span := trace.FromContext(ctx)
|
||||
if span != nil {
|
||||
sctx := span.SpanContext()
|
||||
return logrus.WithFields(logrus.Fields{
|
||||
"traceID": sctx.TraceID.String(),
|
||||
"spanID": sctx.SpanID.String(),
|
||||
// "parentSpanID": TODO: JTERRY75 - Try to convince OC to export this?
|
||||
})
|
||||
}
|
||||
return logrus.NewEntry(logrus.StandardLogger())
|
||||
}
|
Reference in New Issue
Block a user