Skip to content

Commit a0ff58d

Browse files
committed
fixup! feat: Add context to preflight check messages
Address review feedback
1 parent 4e94afe commit a0ff58d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/webhook/preflight/nutanix/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (c *imageCheck) Run(ctx context.Context) preflight.CheckResult {
5858
result.Allowed = false
5959
result.Causes = append(result.Causes, preflight.Cause{
6060
Message: fmt.Sprintf(
61-
"Found %d VM Images in Prism Central that match identifier %q. There must be exactly 1 VM Image that matches this identifier. Remove some VM Images, or use a different VM Image, and then retry.", ///nolint:lll // Message is long.
61+
"Found %d VM Images in Prism Central that match identifier %q. There must be exactly 1 VM Image that matches this identifier. Remove duplicate VM Images, or use a different VM Image, and then retry.", ///nolint:lll // Message is long.
6262
len(images),
6363
c.machineDetails.Image,
6464
),

pkg/webhook/preflight/nutanix/image_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestVMImageCheck(t *testing.T) {
126126
Allowed: false,
127127
Causes: []preflight.Cause{
128128
{
129-
Message: "Found 0 VM Images in Prism Central that match identifier \"test-non-existent-image\". There must be exactly 1 VM Image that matches this identifier. Remove some VM Images, or use a different VM Image, and then retry.", ///nolint:lll // Message is long.
129+
Message: "Found 0 VM Images in Prism Central that match identifier \"test-non-existent-image\". There must be exactly 1 VM Image that matches this identifier. Remove duplicate VM Images, or use a different VM Image, and then retry.", ///nolint:lll // Message is long.
130130
Field: "machineDetails.image",
131131
},
132132
},
@@ -168,7 +168,7 @@ func TestVMImageCheck(t *testing.T) {
168168
Allowed: false,
169169
Causes: []preflight.Cause{
170170
{
171-
Message: "Found 2 VM Images in Prism Central that match identifier \"test-duplicate-image\". There must be exactly 1 VM Image that matches this identifier. Remove some VM Images, or use a different VM Image, and then retry.", ///nolint:lll // Message is long.
171+
Message: "Found 2 VM Images in Prism Central that match identifier \"test-duplicate-image\". There must be exactly 1 VM Image that matches this identifier. Remove duplicate VM Images, or use a different VM Image, and then retry.", ///nolint:lll // Message is long.
172172
Field: "machineDetails.image",
173173
},
174174
},

0 commit comments

Comments
 (0)