Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/overlaybd-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func requestIDInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
requestID = mylog.GenerateRequestID()
ctx = tracing.SetRequestID(ctx, requestID)
}

ctx = mylog.WithRequestID(ctx, requestID)
ctx = log.WithLogger(ctx, log.G(ctx).WithField("req_id", requestID))

Expand Down
48 changes: 24 additions & 24 deletions pkg/convertor/convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,31 +558,31 @@ func (c *overlaybdConvertor) convertLayers(ctx context.Context, srcDescs []ocisp

var remoteDesc ocispec.Descriptor

if c.remote {
fmt.Printf("convertLayers: Looking for remote layer\n")
span.AddEvent("remote_check_start", trace.WithAttributes(
attribute.String("host", c.host),
attribute.String("repo", c.repo),
attribute.String("chainID", chainID),
))

remoteDesc, err = c.findRemote(ctx, chainID)
if err != nil {
if !errdefs.IsNotFound(err) {
fmt.Printf("convertLayers: ERROR finding remote: %v\n", err)
addErrorEvent(span, err, "remote_check", desc)
return nil, err
if c.remote {
fmt.Printf("convertLayers: Looking for remote layer\n")
span.AddEvent("remote_check_start", trace.WithAttributes(
attribute.String("host", c.host),
attribute.String("repo", c.repo),
attribute.String("chainID", chainID),
))

remoteDesc, err = c.findRemote(ctx, chainID)
if err != nil {
if !errdefs.IsNotFound(err) {
fmt.Printf("convertLayers: ERROR finding remote: %v\n", err)
addErrorEvent(span, err, "remote_check", desc)
return nil, err
}
fmt.Printf("convertLayers: Remote layer not found, will process locally\n")
} else {
fmt.Printf("convertLayers: Found remote layer\n")
}
fmt.Printf("convertLayers: Remote layer not found, will process locally\n")
} else {
fmt.Printf("convertLayers: Found remote layer\n")
}

span.AddEvent("remote_check_complete", trace.WithAttributes(
attribute.Bool("found", err == nil),
attribute.String("chainID", chainID),
))
}
span.AddEvent("remote_check_complete", trace.WithAttributes(
attribute.Bool("found", err == nil),
attribute.String("chainID", chainID),
))
}

if c.remote && err == nil {
key := fmt.Sprintf(convSnapshotNameFormat, chainID)
Expand Down Expand Up @@ -678,7 +678,7 @@ func (c *overlaybdConvertor) applyOCIV1LayerInObd(
afterApply func(root string) error, // do something after apply tar stream
) (string, error) {
startTime := time.Now()

ctx, span := tracer.Start(ctx, "applyOCIV1LayerInObd",
trace.WithAttributes(
attribute.String("parent_id", parentID),
Expand Down
2 changes: 1 addition & 1 deletion pkg/convertor/trace_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ func addErrorEvent(span trace.Span, err error, operation string, desc ocispec.De
attribute.String("layer_digest", desc.Digest.String()),
attribute.String("error_type", getErrorType(err)),
))
}
}
2 changes: 1 addition & 1 deletion pkg/convertor/trace_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ func TestGetDiskUsage(t *testing.T) {
if usage <= 0 {
t.Errorf("Expected positive disk usage, got %d", usage)
}
}
}
2 changes: 1 addition & 1 deletion pkg/tracing/baggage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ func TestSimplifiedBaggage(t *testing.T) {
if member.Value() != "test-12345" {
t.Errorf("Expected baggage value 'test-12345', got '%s'", member.Value())
}
}
}
2 changes: 1 addition & 1 deletion pkg/tracing/propagation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestTraceIDPropagation(t *testing.T) {
validSpans++
}
}

if validSpans == 0 {
t.Error("No valid spans found")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ func IsProvenanceDescriptor(desc v1.Descriptor) bool {
}

return false
}
}
2 changes: 1 addition & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package tools

import (
_ "gotest.tools/gotestsum"
)
)
Loading