Skip to content

Commit f9672c8

Browse files
committed
fix unused
Signed-off-by: yafeiaa <[email protected]>
1 parent 4911a62 commit f9672c8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Diff for: go.mod

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ require (
1111
github.com/google/uuid v1.6.0
1212
github.com/spf13/cobra v1.9.1
1313
github.com/stretchr/testify v1.10.0
14+
go.opentelemetry.io/otel v1.28.0
15+
go.opentelemetry.io/otel/trace v1.28.0
1416
golang.org/x/sync v0.11.0
1517
google.golang.org/protobuf v1.36.5
1618
k8s.io/api v0.32.2
1719
k8s.io/apiextensions-apiserver v0.32.2
1820
k8s.io/apimachinery v0.32.2
1921
k8s.io/cli-runtime v0.32.2
2022
k8s.io/client-go v0.32.2
21-
go.opentelemetry.io/otel v1.28.0
22-
go.opentelemetry.io/otel/trace v1.28.0
2323
k8s.io/klog/v2 v2.130.1
2424
k8s.io/kube-aggregator v0.32.2
2525
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7
@@ -80,8 +80,6 @@ require (
8080
github.com/stretchr/objx v0.5.2 // indirect
8181
github.com/x448/float16 v0.8.4 // indirect
8282
github.com/xlab/treeprint v1.2.0 // indirect
83-
go.opentelemetry.io/otel v1.28.0 // indirect
84-
go.opentelemetry.io/otel/trace v1.28.0 // indirect
8583
golang.org/x/net v0.33.0 // indirect
8684
golang.org/x/oauth2 v0.23.0 // indirect
8785
golang.org/x/sys v0.28.0 // indirect

Diff for: pkg/sync/sync_context.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ func (sc *syncContext) runTasks(tasks syncTasks, dryRun bool) runState {
12731273
ss.Go(func(state runState) runState {
12741274
logCtx := sc.log.WithValues("dryRun", dryRun, "task", t)
12751275
logCtx.V(1).Info("Pruning")
1276-
span := sc.syncTracer.StartSpanFromTraceParent("pruneObject", sc.syncTraceID, sc.syncTraceRootSpanID)
1276+
span := sc.createSpan("pruneObject", dryRun)
12771277
defer span.Finish()
12781278
result, message := sc.pruneObject(t.liveObj, sc.prune, dryRun)
12791279
if result == common.ResultCodeSyncFailed {
@@ -1303,7 +1303,7 @@ func (sc *syncContext) runTasks(tasks syncTasks, dryRun bool) runState {
13031303
ss.Go(func(state runState) runState {
13041304
sc.log.WithValues("dryRun", dryRun, "task", t).V(1).Info("Deleting")
13051305
if !dryRun {
1306-
span := sc.syncTracer.StartSpanFromTraceParent("hooksDeletion", sc.syncTraceID, sc.syncTraceRootSpanID)
1306+
span := sc.createSpan("hooksDeletion", dryRun)
13071307
defer span.Finish()
13081308
err := sc.deleteResource(t)
13091309
message := "deleted"
@@ -1381,7 +1381,7 @@ func (sc *syncContext) processCreateTasks(state runState, tasks syncTasks, dryRu
13811381
logCtx := sc.log.WithValues("dryRun", dryRun, "task", t)
13821382
logCtx.V(1).Info("Applying")
13831383
validate := sc.validate && !resourceutil.HasAnnotationOption(t.targetObj, common.AnnotationSyncOptions, common.SyncOptionsDisableValidation)
1384-
span := sc.syncTracer.StartSpanFromTraceParent("applyObject", sc.syncTraceID, sc.syncTraceRootSpanID)
1384+
span := sc.createSpan("applyObject", dryRun)
13851385
defer span.Finish()
13861386
result, message := sc.applyObject(t, dryRun, validate)
13871387
if result == common.ResultCodeSyncFailed {

0 commit comments

Comments
 (0)