From 9e2ef850bd1d03fc1f90925be06360739091856b Mon Sep 17 00:00:00 2001 From: Viktor Kramarenko Date: Mon, 26 Aug 2024 15:07:50 +0300 Subject: [PATCH] test fixes and some refactoring Signed-off-by: Viktor Kramarenko --- images/agent/src/pkg/controller/block_device_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/agent/src/pkg/controller/block_device_test.go b/images/agent/src/pkg/controller/block_device_test.go index 7d305d13..7bb31398 100644 --- a/images/agent/src/pkg/controller/block_device_test.go +++ b/images/agent/src/pkg/controller/block_device_test.go @@ -340,6 +340,10 @@ func TestBlockDeviceCtrl(t *testing.T) { MachineID: "testMACHINE", }, } + blockDevice.Labels = map[string]string{ + "some-custom-label1": "v", + "some-custom-label2": "v", + } expectedLabels := map[string]string{ "kubernetes.io/metadata.name": blockDevice.ObjectMeta.Name, @@ -358,6 +362,8 @@ func TestBlockDeviceCtrl(t *testing.T) { BlockDeviceLabelPrefix + "/rota": strconv.FormatBool(blockDevice.Status.Rota), BlockDeviceLabelPrefix + "/hotplug": strconv.FormatBool(blockDevice.Status.HotPlug), BlockDeviceLabelPrefix + "/machineid": blockDevice.Status.MachineID, + "some-custom-label1": "v", + "some-custom-label2": "v", } assert.Equal(t, expectedLabels, ConfigureBlockDeviceLabels(blockDevice))