From 048fbed8450f48c34e92661d5ac663846a0b649c Mon Sep 17 00:00:00 2001 From: DerekFrank Date: Mon, 18 Aug 2025 09:52:15 -0700 Subject: [PATCH] gofmt and review feedback Kubernetes-commit: 2180b441dd748bcaf9c1c8a28d20f6565e14f189 --- tools/leaderelection/resourcelock/leaselock_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/leaderelection/resourcelock/leaselock_test.go b/tools/leaderelection/resourcelock/leaselock_test.go index 072ed4b5..f30bcfe2 100644 --- a/tools/leaderelection/resourcelock/leaselock_test.go +++ b/tools/leaderelection/resourcelock/leaselock_test.go @@ -278,6 +278,8 @@ func TestUpdateWithNilLabelsOnLease(t *testing.T) { t.Fatalf("Failed to get lease: %v", err) } + leaseLock.lease.Labels = nil + leaseLock.Labels = map[string]string{"custom-key": "custom-val"} // Update should succeed even with nil Labels on the lease itself @@ -286,7 +288,6 @@ func TestUpdateWithNilLabelsOnLease(t *testing.T) { } } - func TestUpdateWithNilLabelsOnLeaseLock(t *testing.T) { setup() @@ -299,6 +300,8 @@ func TestUpdateWithNilLabelsOnLeaseLock(t *testing.T) { t.Fatalf("Failed to get lease: %v", err) } + leaseLock.Labels = nil + leaseLock.lease.Labels = map[string]string{"custom-key": "custom-val"} // Update should succeed even with nil Labels on the leaselock @@ -371,4 +374,4 @@ func TestLabelUpdate(t *testing.T) { if val != "custom-val-2" { t.Errorf("Label value mismatch, got %q want %q", val, "custom-val-2") } -} \ No newline at end of file +}