diff --git a/pkg/agent/logging.go b/pkg/agent/logging.go index 6cb78ceec1..6b8ae42f00 100644 --- a/pkg/agent/logging.go +++ b/pkg/agent/logging.go @@ -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 } diff --git a/pkg/asset/manifests/azure/cluster.go b/pkg/asset/manifests/azure/cluster.go index 399cc746d9..cc1c2c18c1 100644 --- a/pkg/asset/manifests/azure/cluster.go +++ b/pkg/asset/manifests/azure/cluster.go @@ -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, diff --git a/pkg/infrastructure/azure/storage.go b/pkg/infrastructure/azure/storage.go index 3f048ebeeb..68b5d8b611 100644 --- a/pkg/infrastructure/azure/storage.go +++ b/pkg/infrastructure/azure/storage.go @@ -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 { diff --git a/pkg/infrastructure/baremetal/image.go b/pkg/infrastructure/baremetal/image.go index 3c13146c61..09e9a7aa1e 100644 --- a/pkg/infrastructure/baremetal/image.go +++ b/pkg/infrastructure/baremetal/image.go @@ -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 }