mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-08-25 04:45:46 +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:
parent
4da593d727
commit
092edf2d08
@ -1,6 +1,6 @@
|
|||||||
FROM golang:1.24.5@sha256:ef5b4be1f94b36c90385abd9b6b4f201723ae28e71acacb76d00687333c17282
|
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 && \
|
RUN apt update && apt upgrade -y && \
|
||||||
apt-get install --no-install-recommends -y ca-certificates curl gnupg lsb-release jq zsh neovim gh && \
|
apt-get install --no-install-recommends -y ca-certificates curl gnupg lsb-release jq zsh neovim gh && \
|
||||||
|
2
.github/workflows/golangci-lint.yml
vendored
2
.github/workflows/golangci-lint.yml
vendored
@ -42,6 +42,6 @@ jobs:
|
|||||||
if: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.linter == 'true'}}
|
if: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.linter == 'true'}}
|
||||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
|
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
|
||||||
with:
|
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
|
skip-cache: true
|
||||||
args: -v --timeout=10m
|
args: -v --timeout=10m
|
||||||
|
2
Makefile
2
Makefile
@ -3,7 +3,7 @@ TARGETS=darwin linux windows
|
|||||||
TERRAFORM_PLUGIN_EXTENSION=
|
TERRAFORM_PLUGIN_EXTENSION=
|
||||||
VERSION=0.80.0# x-release-please-version
|
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,
|
# check if opentofu is installed and use it if it is,
|
||||||
# otherwise use terraform
|
# otherwise use terraform
|
||||||
|
@ -605,10 +605,12 @@ func (r *apiResolver) Resolve(ctx context.Context, nodeName string) (ssh.Proxmox
|
|||||||
// fallback 3: do a good old DNS lookup
|
// fallback 3: do a good old DNS lookup
|
||||||
tflog.Debug(ctx, fmt.Sprintf("Attempting a DNS lookup of node %q.", nc.NodeName))
|
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 {
|
if err == nil {
|
||||||
for _, ip := range ips {
|
for _, ip := range ips {
|
||||||
if ipv4 := ip.To4(); ipv4 != nil {
|
if ipv4 := ip.IP.To4(); ipv4 != nil {
|
||||||
nodeAddress = ipv4.String()
|
nodeAddress = ipv4.String()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -619,7 +619,7 @@ func (c *client) createSSHClientAgent(
|
|||||||
kh *knownhosts.HostKeyDB,
|
kh *knownhosts.HostKeyDB,
|
||||||
sshHost string,
|
sshHost string,
|
||||||
) (*ssh.Client, error) {
|
) (*ssh.Client, error) {
|
||||||
conn, err := dialSocket(c.agentSocket)
|
conn, err := dialSocket(ctx, c.agentSocket)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed connecting to SSH auth socket '%s': %w", c.agentSocket, err)
|
return nil, fmt.Errorf("failed connecting to SSH auth socket '%s': %w", c.agentSocket, err)
|
||||||
}
|
}
|
||||||
|
@ -3,19 +3,22 @@
|
|||||||
package ssh
|
package ssh
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
)
|
)
|
||||||
|
|
||||||
// dialSocket dials a Unix domain socket.
|
// 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 == "" {
|
if address == "" {
|
||||||
return nil, errors.New("failed connecting to SSH agent socket: the socket file is not defined, " +
|
return nil, errors.New("failed connecting to SSH agent socket: the socket file is not defined, " +
|
||||||
"authentication will fall back to password")
|
"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 {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error dialing unix socket: %w", err)
|
return nil, fmt.Errorf("error dialing unix socket: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
package ssh
|
package ssh
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
@ -10,12 +11,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// dialSocket dials a Windows named pipe. If address is empty, it dials the default ssh-agent pipe.
|
// 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 == "" {
|
if address == "" {
|
||||||
address = `\\.\pipe\openssh-ssh-agent`
|
address = `\\.\pipe\openssh-ssh-agent`
|
||||||
}
|
}
|
||||||
|
|
||||||
conn, err := winio.DialPipe(address, nil)
|
conn, err := winio.DialPipeContext(ctx, address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error dialing named pipe: %w", err)
|
return nil, fmt.Errorf("error dialing named pipe: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -296,10 +296,12 @@ func (r *apiResolver) Resolve(ctx context.Context, nodeName string) (ssh.Proxmox
|
|||||||
// fallback 3: do a good old DNS lookup
|
// fallback 3: do a good old DNS lookup
|
||||||
tflog.Debug(ctx, fmt.Sprintf("Attempting a DNS lookup of node %q.", nc.NodeName))
|
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 {
|
if err == nil {
|
||||||
for _, ip := range ips {
|
for _, ip := range ips {
|
||||||
if ipv4 := ip.To4(); ipv4 != nil {
|
if ipv4 := ip.IP.To4(); ipv4 != nil {
|
||||||
nodeAddress = ipv4.String()
|
nodeAddress = ipv4.String()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user