Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .golangci-lint-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ linters:
gosec:
excludes:
- G115
gocyclo:
min-complexity: 45
staticcheck:
checks:
# Default
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func printChannelLogs(ip string, ch chan logEntry) {
func printLogs(wg *sync.WaitGroup, ipChanMap map[string]chan logEntry) {
defer wg.Done()
for {
if len(ipChanMap) == 0 {
if len(ipChanMap) == 0 { //nolint: staticcheck
// no IPs to monitor or all channels are closed, exit loop
break
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/asset/manifests/azure/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,14 @@ func getSubnet(installConfig *installconfig.InstallConfig, subnetType capz.Subne
}
ctx := context.TODO()

if subnetType == capz.SubnetControlPlane {
switch subnetType {
case capz.SubnetControlPlane:
subnet, err = azClient.GetControlPlaneSubnet(ctx,
installConfig.Config.Azure.NetworkResourceGroupName,
installConfig.Config.Azure.VirtualNetwork,
subnetName,
)
} else if subnetType == capz.SubnetNode {
case capz.SubnetNode:
subnet, err = azClient.GetComputeSubnet(ctx,
installConfig.Config.Azure.NetworkResourceGroupName,
installConfig.Config.Azure.VirtualNetwork,
Expand Down
5 changes: 1 addition & 4 deletions pkg/infrastructure/azure/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ func CreateStorageAccount(ctx context.Context, in *CreateStorageAccountInput) (*
//APIVersion: "2019-06-01",
},
}
allowSharedKeyAccess := true
if in.AuthType == azic.ManagedIdentityAuth {
allowSharedKeyAccess = false
}
allowSharedKeyAccess := in.AuthType != azic.ManagedIdentityAuth

storageClientFactory, err := armstorage.NewClientFactory(in.SubscriptionID, in.TokenCredential, opts)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/infrastructure/baremetal/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (i *localImage) Import(copier func(io.Reader) error, vol libvirtxml.Storage
}
// we can skip the upload if the modification times are the same
if vol.Target.Timestamps != nil && vol.Target.Timestamps.Mtime != "" {
if fi.ModTime() == timeFromEpoch(vol.Target.Timestamps.Mtime) {
if fi.ModTime().Equal(timeFromEpoch(vol.Target.Timestamps.Mtime)) {
logrus.Info("Modification time is the same: skipping image copy")
return nil
}
Expand Down