Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbenjemaa committed Feb 1, 2024
1 parent 3c50aca commit 2eddfa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions internal/service/vmservice/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ func handleDefaultDevice(ctx context.Context, machineScope *scope.MachineScope,
return false, nil
}

// nolint
func handleAdditionalDevices(ctx context.Context, machineScope *scope.MachineScope, addresses map[string]infrav1.IPAddress) (bool, error) {
// additional network devices.
for _, net := range machineScope.ProxmoxMachine.Spec.Network.AdditionalDevices {
Expand Down Expand Up @@ -202,7 +201,6 @@ func handleAdditionalDevices(ctx context.Context, machineScope *scope.MachineSco
addresses[net.Name] = infrav1.IPAddress{
IPV6: "DHCP",
}
return false, nil
} else {
ip, err := handleIPAddressForDevice(ctx, machineScope, net.Name, infrav1.IPV6Format, net.IPv6PoolRef)
if err != nil || ip == "" {
Expand Down
16 changes: 7 additions & 9 deletions internal/service/vmservice/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ func reconcileMachineAddresses(ctx context.Context, scope *scope.MachineScope) e
return nil
}

// getMachineAddresses returns the ip addresses for the machine
// nolint
// getMachineAddresses returns the ip addresses for the machine.
func getMachineAddresses(ctx context.Context, scope *scope.MachineScope) ([]clusterv1.MachineAddress, error) {
if !machineHasIPAddress(scope.ProxmoxMachine) {
return nil, errors.New("machine does not yet have an ip address")
Expand Down Expand Up @@ -297,14 +296,13 @@ func getMachineAddresses(ctx context.Context, scope *scope.MachineScope) ([]clus

setMachineAddresses(scope, &addresses, ipv4, ipv6)
return addresses, nil
} else {
if scope.InfraCluster.ProxmoxCluster.Spec.IPv4Config != nil {
ipv4 = scope.ProxmoxMachine.Status.IPAddresses[infrav1alpha1.DefaultNetworkDevice].IPV4
}
}
if scope.InfraCluster.ProxmoxCluster.Spec.IPv4Config != nil {
ipv4 = scope.ProxmoxMachine.Status.IPAddresses[infrav1alpha1.DefaultNetworkDevice].IPV4
}

if scope.InfraCluster.ProxmoxCluster.Spec.IPv6Config != nil {
ipv6 = scope.ProxmoxMachine.Status.IPAddresses[infrav1alpha1.DefaultNetworkDevice].IPV6
}
if scope.InfraCluster.ProxmoxCluster.Spec.IPv6Config != nil {
ipv6 = scope.ProxmoxMachine.Status.IPAddresses[infrav1alpha1.DefaultNetworkDevice].IPV6
}

setMachineAddresses(scope, &addresses, ipv4, ipv6)
Expand Down

0 comments on commit 2eddfa8

Please sign in to comment.