Skip to content

Commit 0cca0e8

Browse files
committed
fixup! feat(preflight): Add a check for storage containers
Declare result as value instead of reference, since a refrence is not necessary.
1 parent 07fccbc commit 0cca0e8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/webhook/preflight/nutanix/storagecontainer.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import (
77
"context"
88
"fmt"
99

10-
prismv4 "github.com/nutanix-cloud-native/prism-go-client/v4"
1110
clustermgmtv4 "github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4/models/clustermgmt/v4/config"
1211
"k8s.io/utils/ptr"
1312

13+
prismv4 "github.com/nutanix-cloud-native/prism-go-client/v4"
14+
1415
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/external/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
1516
carenv1 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
1617
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/webhook/preflight"
@@ -62,7 +63,7 @@ func (n *nutanixChecker) storageContainerCheck(
6263
)
6364

6465
return func(ctx context.Context) preflight.CheckResult {
65-
result := &preflight.CheckResult{}
66+
result := preflight.CheckResult{}
6667
if csiSpec == nil {
6768
result.Allowed = false
6869
result.Error = true
@@ -74,7 +75,7 @@ func (n *nutanixChecker) storageContainerCheck(
7475
Field: field,
7576
})
7677

77-
return *result
78+
return result
7879
}
7980

8081
if csiSpec.StorageClassConfigs == nil {
@@ -87,7 +88,7 @@ func (n *nutanixChecker) storageContainerCheck(
8788
Field: field,
8889
})
8990

90-
return *result
91+
return result
9192
}
9293

9394
for _, storageClassConfig := range csiSpec.StorageClassConfigs {
@@ -114,11 +115,11 @@ func (n *nutanixChecker) storageContainerCheck(
114115
Field: field,
115116
})
116117

117-
return *result
118+
return result
118119
}
119120
}
120121

121-
return *result
122+
return result
122123
}
123124
}
124125

0 commit comments

Comments
 (0)