Skip to content

Commit

Permalink
Merge pull request #2410 from adityabhatia/removeNestIfLint
Browse files Browse the repository at this point in the history
🌱 remove //nolint:nestif directives
  • Loading branch information
k8s-ci-robot authored Sep 29, 2023
2 parents 868fd6f + 04bb81b commit 3b7fbc6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions controllers/vspherecluster_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

//nolint:nestif

// Package controllers contains controllers for CAPV objects.
package controllers

Expand Down
1 change: 0 additions & 1 deletion pkg/services/govmomi/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func (vms *VMService) ReconcileVM(ctx *context.VMContext) (vm infrav1.VirtualMac

// Before going further, we need the VM's managed object reference.
vmRef, err := findVM(ctx)
//nolint:nestif
if err != nil {
if !isNotFound(err) {
return vm, err
Expand Down
5 changes: 2 additions & 3 deletions pkg/services/govmomi/vcenter/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Clone(ctx *context.VMContext, bootstrapData []byte, format bootstrapv1.Form
// If a linked clone is requested then a MoRef for a snapshot must be
// found with which to perform the linked clone.
var snapshotRef *types.ManagedObjectReference
//nolint:nestif

if ctx.VSphereVM.Spec.CloneMode == "" || ctx.VSphereVM.Spec.CloneMode == infrav1.LinkedClone {
ctx.Logger.Info("linked clone requested")
// If the name of a snapshot was not provided then find the template's
Expand All @@ -103,7 +103,7 @@ func Clone(ctx *context.VMContext, bootstrapData []byte, format bootstrapv1.Form
}
}

// The type of clone operation depends on whether or not there is a snapshot
// The type of clone operation depends on whether there is a snapshot
// from which to do a linked clone.
diskMoveType := fullCloneDiskMoveType
ctx.VSphereVM.Status.CloneMode = infrav1.FullClone
Expand Down Expand Up @@ -215,7 +215,6 @@ func Clone(ctx *context.VMContext, bootstrapData []byte, format bootstrapv1.Form
}

var storageProfileID string
//nolint:nestif
if ctx.VSphereVM.Spec.StoragePolicyName != "" {
pbmClient, err := pbm.NewClient(ctx, ctx.Session.Client.Client)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions pkg/services/vimmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ func (v *VimMachineService) reconcileProviderID(vimMachineCtx *capvcontext.VIMMa
return true, nil
}

//nolint:nestif
func (v *VimMachineService) reconcileNetwork(vimMachineCtx *capvcontext.VIMMachineContext, vm *infrav1.VSphereVM) (bool, error) {
var errs []error
networkStatusListOfIfaces := vm.Status.Network
Expand Down Expand Up @@ -411,8 +410,6 @@ func generateVMObjectName(vimMachineCtx *capvcontext.VIMMachineContext, machineN

// generateOverrideFunc returns a function which can override the values in the VSphereVM Spec
// with the values from the FailureDomain (if any) set on the owner CAPI machine.
//
//nolint:nestif
func (v *VimMachineService) generateOverrideFunc(vimMachineCtx *capvcontext.VIMMachineContext) (func(vm *infrav1.VSphereVM), bool) {
failureDomainName := vimMachineCtx.Machine.Spec.FailureDomain
if failureDomainName == nil {
Expand Down

0 comments on commit 3b7fbc6

Please sign in to comment.