Skip to content

Commit

Permalink
test fixes and some refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Kramarenko <[email protected]>
  • Loading branch information
ViktorKram committed Aug 26, 2024
1 parent c648ce9 commit 9e2ef85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions images/agent/src/pkg/controller/block_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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))
Expand Down

0 comments on commit 9e2ef85

Please sign in to comment.