From b88b3d01f116165d3e1fc6946eb7ee6a58c5e8f8 Mon Sep 17 00:00:00 2001 From: jnarezo Date: Wed, 11 Sep 2024 22:14:41 -0700 Subject: [PATCH] fix(vol): fix unit test --- pkg/instrumentation/helper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/instrumentation/helper.go b/pkg/instrumentation/helper.go index 2e65b5e297..45a08a214b 100644 --- a/pkg/instrumentation/helper.go +++ b/pkg/instrumentation/helper.go @@ -125,9 +125,9 @@ func isInstrWithoutContainers(inst instrumentationWithContainers) int { } func instrVolume(volume corev1.Volume, name string, volumeSizeLimit *resource.Quantity) (corev1.Volume, error) { - if reflect.ValueOf(volume).IsValid() && volumeSizeLimit != nil { + if !reflect.ValueOf(volume).IsZero() && volumeSizeLimit != nil { return volume, fmt.Errorf("both Volume and VolumeSizeLimit cannot be defined simultaneously") - } else if reflect.ValueOf(volume).IsValid() { + } else if !reflect.ValueOf(volume).IsZero() { return volume, nil }