Skip to content

Commit 370078d

Browse files
chore: Switch dry run applies to log with debug level (argoproj#705)
Signed-off-by: Andrii Korotkov <[email protected]>
1 parent 7258614 commit 370078d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/utils/kube/resource_ops.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func (k *kubectlServerSideDiffDryRunApplier) ApplyResource(_ context.Context, ob
306306
span.SetBaggageItem("kind", obj.GetKind())
307307
span.SetBaggageItem("name", obj.GetName())
308308
defer span.Finish()
309-
k.log.WithValues(
309+
k.log.V(1).WithValues(
310310
"dry-run", [...]string{"none", "client", "server"}[dryRunStrategy],
311311
"manager", manager,
312312
"serverSideApply", serverSideApply).Info(fmt.Sprintf("Running server-side diff. Dry run applying resource %s/%s in cluster: %s, namespace: %s", obj.GetKind(), obj.GetName(), k.config.Host, obj.GetNamespace()))
@@ -332,7 +332,11 @@ func (k *kubectlResourceOperations) ApplyResource(ctx context.Context, obj *unst
332332
span.SetBaggageItem("kind", obj.GetKind())
333333
span.SetBaggageItem("name", obj.GetName())
334334
defer span.Finish()
335-
k.log.WithValues(
335+
logWithLevel := k.log
336+
if dryRunStrategy != cmdutil.DryRunNone {
337+
logWithLevel = logWithLevel.V(1)
338+
}
339+
logWithLevel.WithValues(
336340
"dry-run", [...]string{"none", "client", "server"}[dryRunStrategy],
337341
"manager", manager,
338342
"serverSideApply", serverSideApply,

0 commit comments

Comments
 (0)