From 092edf2d08901c8e579cc6927b14ec5613547a00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:47:20 -0400 Subject: [PATCH] =?UTF-8?q?chore(deps):=20update=20golangci/golangci-lint?= =?UTF-8?q?=20(v2.2.2=20=E2=86=92=20v2.3.0)=20(#2056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- .devcontainer/Dockerfile | 2 +- .github/workflows/golangci-lint.yml | 2 +- Makefile | 2 +- fwprovider/provider.go | 6 ++++-- proxmox/ssh/client.go | 2 +- proxmox/ssh/client_notwindows.go | 7 +++++-- proxmox/ssh/client_windows.go | 5 +++-- proxmoxtf/provider/provider.go | 6 ++++-- 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4b128059..9455ff0b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 && \ diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 938b3868..cf82beb4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -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 diff --git a/Makefile b/Makefile index 1009707c..14c58548 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/fwprovider/provider.go b/fwprovider/provider.go index da8b9a29..c578e2e8 100644 --- a/fwprovider/provider.go +++ b/fwprovider/provider.go @@ -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 } diff --git a/proxmox/ssh/client.go b/proxmox/ssh/client.go index f7c04971..a0703485 100644 --- a/proxmox/ssh/client.go +++ b/proxmox/ssh/client.go @@ -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) } diff --git a/proxmox/ssh/client_notwindows.go b/proxmox/ssh/client_notwindows.go index 35f0a5d0..13f727df 100644 --- a/proxmox/ssh/client_notwindows.go +++ b/proxmox/ssh/client_notwindows.go @@ -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) } diff --git a/proxmox/ssh/client_windows.go b/proxmox/ssh/client_windows.go index 180e81c1..539e5c17 100644 --- a/proxmox/ssh/client_windows.go +++ b/proxmox/ssh/client_windows.go @@ -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) } diff --git a/proxmoxtf/provider/provider.go b/proxmoxtf/provider/provider.go index 20e90da6..1315d09a 100644 --- a/proxmoxtf/provider/provider.go +++ b/proxmoxtf/provider/provider.go @@ -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 }