0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-22 11:28:33 +00:00

chore(deps): update golangci/golangci-lint (v2.2.2 → v2.3.0) (#2056)

* chore(deps): update golangci/golangci-lint (v2.2.2 → v2.3.0)

| datasource      | package                | from   | to     |
| --------------- | ---------------------- | ------ | ------ |
| github-releases | golangci/golangci-lint | v2.2.2 | v2.3.0 |

* fix: linter errors

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>

---------

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2025-07-28 08:47:20 -04:00 committed by GitHub
parent 4da593d727
commit 092edf2d08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 20 additions and 12 deletions

View File

@ -1,6 +1,6 @@
FROM golang:1.24.5@sha256:ef5b4be1f94b36c90385abd9b6b4f201723ae28e71acacb76d00687333c17282
ARG GOLANGCI_LINT_VERSION=2.2.2 # renovate: depName=golangci/golangci-lint datasource=github-releases
ARG GOLANGCI_LINT_VERSION=2.3.0 # renovate: depName=golangci/golangci-lint datasource=github-releases
RUN apt update && apt upgrade -y && \
apt-get install --no-install-recommends -y ca-certificates curl gnupg lsb-release jq zsh neovim gh && \

View File

@ -42,6 +42,6 @@ jobs:
if: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.linter == 'true'}}
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
with:
version: v2.2.2 # renovate: depName=golangci/golangci-lint datasource=github-releases
version: v2.3.0 # renovate: depName=golangci/golangci-lint datasource=github-releases
skip-cache: true
args: -v --timeout=10m

View File

@ -3,7 +3,7 @@ TARGETS=darwin linux windows
TERRAFORM_PLUGIN_EXTENSION=
VERSION=0.80.0# x-release-please-version
GOLANGCI_LINT_VERSION=2.2.2# renovate: depName=golangci/golangci-lint datasource=github-releases
GOLANGCI_LINT_VERSION=2.3.0# renovate: depName=golangci/golangci-lint datasource=github-releases
# check if opentofu is installed and use it if it is,
# otherwise use terraform

View File

@ -605,10 +605,12 @@ func (r *apiResolver) Resolve(ctx context.Context, nodeName string) (ssh.Proxmox
// fallback 3: do a good old DNS lookup
tflog.Debug(ctx, fmt.Sprintf("Attempting a DNS lookup of node %q.", nc.NodeName))
ips, err := net.LookupIP(nodeName)
resolver := &net.Resolver{}
ips, err := resolver.LookupIPAddr(ctx, nodeName)
if err == nil {
for _, ip := range ips {
if ipv4 := ip.To4(); ipv4 != nil {
if ipv4 := ip.IP.To4(); ipv4 != nil {
nodeAddress = ipv4.String()
break
}

View File

@ -619,7 +619,7 @@ func (c *client) createSSHClientAgent(
kh *knownhosts.HostKeyDB,
sshHost string,
) (*ssh.Client, error) {
conn, err := dialSocket(c.agentSocket)
conn, err := dialSocket(ctx, c.agentSocket)
if err != nil {
return nil, fmt.Errorf("failed connecting to SSH auth socket '%s': %w", c.agentSocket, err)
}

View File

@ -3,19 +3,22 @@
package ssh
import (
"context"
"errors"
"fmt"
"net"
)
// dialSocket dials a Unix domain socket.
func dialSocket(address string) (net.Conn, error) {
func dialSocket(ctx context.Context, address string) (net.Conn, error) {
if address == "" {
return nil, errors.New("failed connecting to SSH agent socket: the socket file is not defined, " +
"authentication will fall back to password")
}
conn, err := net.Dial("unix", address)
dialer := &net.Dialer{}
conn, err := dialer.DialContext(ctx, "unix", address)
if err != nil {
return nil, fmt.Errorf("error dialing unix socket: %w", err)
}

View File

@ -3,6 +3,7 @@
package ssh
import (
"context"
"fmt"
"net"
@ -10,12 +11,12 @@ import (
)
// dialSocket dials a Windows named pipe. If address is empty, it dials the default ssh-agent pipe.
func dialSocket(address string) (net.Conn, error) {
func dialSocket(ctx context.Context, address string) (net.Conn, error) {
if address == "" {
address = `\\.\pipe\openssh-ssh-agent`
}
conn, err := winio.DialPipe(address, nil)
conn, err := winio.DialPipeContext(ctx, address)
if err != nil {
return nil, fmt.Errorf("error dialing named pipe: %w", err)
}

View File

@ -296,10 +296,12 @@ func (r *apiResolver) Resolve(ctx context.Context, nodeName string) (ssh.Proxmox
// fallback 3: do a good old DNS lookup
tflog.Debug(ctx, fmt.Sprintf("Attempting a DNS lookup of node %q.", nc.NodeName))
ips, err := net.LookupIP(nodeName)
resolver := &net.Resolver{}
ips, err := resolver.LookupIPAddr(ctx, nodeName)
if err == nil {
for _, ip := range ips {
if ipv4 := ip.To4(); ipv4 != nil {
if ipv4 := ip.IP.To4(); ipv4 != nil {
nodeAddress = ipv4.String()
break
}