Port osbuild/images v0.33.0 with dot-notation to composer
Update the osbuild/images to the version which introduces "dot notation" for distro release versions. - Replace all uses of distroregistry by distrofactory. - Delete local version of reporegistry and use the one from the osbuild/images. - Weldr: unify `createWeldrAPI()` and `createWeldrAPI2()` into a single `createTestWeldrAPI()` function`. - store/fixture: rework fixtures to allow overriding the host distro name and host architecture name. A cleanup function to restore the host distro and arch names is always part of the fixture struct. - Delete `distro_mock` package, since it is no longer used. - Bump the required version of osbuild to 98, because the OSCAP customization is using the 'compress_results' stage option, which is not available in older versions of osbuild. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
f6ff8c40dd
commit
625b1578fa
1166 changed files with 154457 additions and 5508 deletions
58
vendor/github.com/Microsoft/hcsshim/internal/oc/span.go
generated
vendored
Normal file
58
vendor/github.com/Microsoft/hcsshim/internal/oc/span.go
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
package oc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Microsoft/hcsshim/internal/log"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
var DefaultSampler = trace.AlwaysSample()
|
||||
|
||||
// SetSpanStatus sets `span.SetStatus` to the proper status depending on `err`. If
|
||||
// `err` is `nil` assumes `trace.StatusCodeOk`.
|
||||
func SetSpanStatus(span *trace.Span, err error) {
|
||||
status := trace.Status{}
|
||||
if err != nil {
|
||||
status.Code = int32(toStatusCode(err))
|
||||
status.Message = err.Error()
|
||||
}
|
||||
span.SetStatus(status)
|
||||
}
|
||||
|
||||
// StartSpan wraps "go.opencensus.io/trace".StartSpan, but, if the span is sampling,
|
||||
// adds a log entry to the context that points to the newly created span.
|
||||
func StartSpan(ctx context.Context, name string, o ...trace.StartOption) (context.Context, *trace.Span) {
|
||||
ctx, s := trace.StartSpan(ctx, name, o...)
|
||||
return update(ctx, s)
|
||||
}
|
||||
|
||||
// StartSpanWithRemoteParent wraps "go.opencensus.io/trace".StartSpanWithRemoteParent.
|
||||
//
|
||||
// See StartSpan for more information.
|
||||
func StartSpanWithRemoteParent(ctx context.Context, name string, parent trace.SpanContext, o ...trace.StartOption) (context.Context, *trace.Span) {
|
||||
ctx, s := trace.StartSpanWithRemoteParent(ctx, name, parent, o...)
|
||||
return update(ctx, s)
|
||||
}
|
||||
|
||||
func update(ctx context.Context, s *trace.Span) (context.Context, *trace.Span) {
|
||||
if s.IsRecordingEvents() {
|
||||
ctx = log.UpdateContext(ctx)
|
||||
}
|
||||
|
||||
return ctx, s
|
||||
}
|
||||
|
||||
var WithServerSpanKind = trace.WithSpanKind(trace.SpanKindServer)
|
||||
var WithClientSpanKind = trace.WithSpanKind(trace.SpanKindClient)
|
||||
|
||||
func spanKindToString(sk int) string {
|
||||
switch sk {
|
||||
case trace.SpanKindClient:
|
||||
return "client"
|
||||
case trace.SpanKindServer:
|
||||
return "server"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue