Skip to content

Commit 86eeb03

Browse files
committed
fix: Remove code that is expected to never run
1 parent 87e6164 commit 86eeb03

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

pkg/webhook/preflight/nutanix/storagecontainer.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ func (c *storageContainerCheck) Run(ctx context.Context) preflight.CheckResult {
3535
Allowed: true,
3636
}
3737

38-
if c.csiSpec == nil {
39-
result.Allowed = false
40-
result.InternalError = true
41-
result.Causes = append(result.Causes, preflight.Cause{
42-
Message: "Nutanix CSI Provider configuration is missing",
43-
Field: c.field,
44-
})
45-
46-
return result
47-
}
48-
4938
if c.csiSpec.StorageClassConfigs == nil {
5039
result.Allowed = false
5140
result.Causes = append(result.Causes, preflight.Cause{

pkg/webhook/preflight/nutanix/storagecontainer_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,20 +264,6 @@ func TestStorageContainerCheck(t *testing.T) {
264264
expectedError bool
265265
expectedCauseMessage string
266266
}{
267-
{
268-
name: "nil CSI spec",
269-
machineSpec: &carenv1.NutanixMachineDetails{
270-
Cluster: capxv1.NutanixResourceIdentifier{
271-
Type: capxv1.NutanixIdentifierName,
272-
Name: ptr.To(clusterName),
273-
},
274-
},
275-
csiSpec: nil,
276-
nclient: nil,
277-
expectedAllowed: false,
278-
expectedError: true,
279-
expectedCauseMessage: "Nutanix CSI Provider configuration is missing",
280-
},
281267
{
282268
name: "nil storage class configs",
283269
machineSpec: &carenv1.NutanixMachineDetails{

0 commit comments

Comments
 (0)