Skip to content

Commit be8b0d2

Browse files
committed
if golint is going to "fix" something, it better not complain about its own "fix"
1 parent 5166c9a commit be8b0d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/controller/linodemachine_controller_helpers.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ func retryIfTransient(err error, logger logr.Logger) (ctrl.Result, error) {
8383
func fillCreateConfig(createConfig *linodego.InstanceCreateOptions, machineScope *scope.MachineScope) {
8484
// This will only be empty if no interfaces or linodeInterfaces were specified in the LinodeMachine spec.
8585
// In that case we default to legacy interfaces.
86-
if createConfig.InterfaceGeneration == "" {
87-
createConfig.InterfaceGeneration = linodego.GenerationLegacyConfig
88-
} else if createConfig.InterfaceGeneration == linodego.GenerationLinode {
86+
switch createConfig.InterfaceGeneration {
87+
case linodego.GenerationLinode:
8988
// networkHelper is only applicable for Linode interfaces.
9089
// legacy interfaces have nework helper configured in reconcilePreflightConfigure at the instance level.
9190
if machineScope.LinodeMachine.Spec.NetworkHelper != nil {
9291
createConfig.NetworkHelper = machineScope.LinodeMachine.Spec.NetworkHelper
9392
} else {
9493
createConfig.NetworkHelper = ptr.To(true)
9594
}
95+
default:
96+
createConfig.InterfaceGeneration = linodego.GenerationLegacyConfig
9697
}
9798

9899
if machineScope.LinodeMachine.Spec.PrivateIP != nil {

0 commit comments

Comments
 (0)