Skip to content

Commit b01bc61

Browse files
committed
fixup! refactor: Apply review suggestions
1 parent a90efa3 commit b01bc61

File tree

1 file changed

+9
-5
lines changed
  • pkg/handlers/generic/lifecycle/csi/nutanix-csi

1 file changed

+9
-5
lines changed

pkg/handlers/generic/lifecycle/csi/nutanix-csi/handler.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (n *NutanixCSI) handleHelmAddonApply(
156156
return fmt.Errorf("failed to get helm chart %q: %w", config.NutanixStorageCSI, err)
157157
}
158158

159-
snapshotHelmChart, err := n.helmChartInfoGetter.For(ctx, log, config.NutanixSnapshotCSI)
159+
snapshotChart, err := n.helmChartInfoGetter.For(ctx, log, config.NutanixSnapshotCSI)
160160
if err != nil {
161161
return fmt.Errorf("failed to get helm chart %q: %w", config.NutanixSnapshotCSI, err)
162162
}
@@ -193,21 +193,25 @@ func (n *NutanixCSI) handleHelmAddonApply(
193193
Name: "nutanix-csi-snapshot-" + req.Cluster.Name,
194194
},
195195
Spec: caaphv1.HelmChartProxySpec{
196-
RepoURL: snapshotHelmChart.Repository,
197-
ChartName: snapshotHelmChart.Name,
196+
RepoURL: snapshotChart.Repository,
197+
ChartName: snapshotChart.Name,
198198
ClusterSelector: metav1.LabelSelector{
199199
MatchLabels: map[string]string{clusterv1.ClusterNameLabel: req.Cluster.Name},
200200
},
201201
ReleaseNamespace: defaultSnapshotHelmReleaseNamespace,
202202
ReleaseName: defaultSnapshotHelmReleaseName,
203-
Version: snapshotHelmChart.Version,
203+
Version: snapshotChart.Version,
204204
},
205205
}
206206

207207
// We use a slice of pointers to satisfy the gocritic linter rangeValCopy check.
208208
for _, cp := range []*caaphv1.HelmChartProxy{storageChartProxy, snapshotChartProxy} {
209209
if err = controllerutil.SetOwnerReference(&req.Cluster, cp, n.client.Scheme()); err != nil {
210-
return fmt.Errorf("failed to set owner reference on HelmChartProxy %q: %w", cp.Name, err)
210+
return fmt.Errorf(
211+
"failed to set owner reference on HelmChartProxy %q: %w",
212+
cp.Name,
213+
err,
214+
)
211215
}
212216

213217
if err = client.ServerSideApply(ctx, n.client, cp, client.ForceOwnership); err != nil {

0 commit comments

Comments
 (0)