Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Dependency updates #322

Merged
merged 6 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 3 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
run:
skip-files:
- ".*_test.go"

linters:
disable-all: true
enable:
Expand All @@ -18,10 +14,12 @@ linters:
- unconvert
- unparam
- unused
- vet
- govet
- gosec

issues:
exclude:
- G404
- G114
exclude-files:
- ".*_test.go"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18 as build
FROM golang:1.22 as build
ENV DOCKER_BUILD=1
ADD . /home/do-agent
WORKDIR /home/do-agent
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ linter = \
-e "GO111MODULE=on" \
-e "GOFLAGS=-mod=vendor" \
-v "$(CURDIR):$(docker_dir)" \
golangci/golangci-lint:v1.50.1
golangci/golangci-lint:v1.58.2

#############
## targets ##
Expand All @@ -83,7 +83,7 @@ test:
build: $(binary)
$(binary): $(gofiles) $(vendorgofiles)
$(print)
$(go) build -ldflags $(ldflags) -o "$(docker_dir)/$@" ./cmd/$(project)
$(go) build -buildvcs=false -ldflags $(ldflags) -o "$(docker_dir)/$@" ./cmd/$(project)

shell:
$(print)
Expand Down
6 changes: 3 additions & 3 deletions cmd/do-agent/config.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package main

import (
"errors"
"fmt"
"hash/fnv"
"net/url"
"os"
"strings"
"time"

"github.com/pkg/errors"
"github.com/alecthomas/kingpin/v2"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
"github.com/prometheus/common/model"
"gopkg.in/alecthomas/kingpin.v2"

"github.com/digitalocean/do-agent/internal/flags"
"github.com/digitalocean/do-agent/internal/log"
Expand Down Expand Up @@ -161,7 +161,7 @@ func checkConfig() error {
var err error
for name, uri := range config.targets {
if _, err = url.Parse(uri); err != nil {
return errors.Wrapf(err, "url for target %q is not valid", name)
return fmt.Errorf("url for target %q is not valid: %w", name, err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/do-agent/config_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "gopkg.in/alecthomas/kingpin.v2"
import "github.com/alecthomas/kingpin/v2"

func init() {
// Overwrite the default disk ignore list, add dm- to ignore LVM devices
Expand Down
3 changes: 1 addition & 2 deletions cmd/do-agent/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"time"

"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

Expand Down Expand Up @@ -99,7 +98,7 @@ func run(w metricWriter, l limiter, dec decorate.Decorator, g gatherer, aggregat
// writeDiagnostics filters all metrics and gathers only the diagnostic information and sends the metrics
// in the event of a write failure
func writeDiagnostics(w metricWriter, mfs []*dto.MetricFamily, err error) {
diagnosticMetric.WithLabelValues(errors.Cause(err).Error()).Inc()
diagnosticMetric.WithLabelValues(err.Error()).Inc()
var diags []*dto.MetricFamily

for _, mf := range mfs {
Expand Down
4 changes: 2 additions & 2 deletions cmd/do-agent/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/digitalocean/do-agent/internal/log"

"github.com/alecthomas/kingpin/v2"
"github.com/prometheus/client_golang/prometheus"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)

var (
Expand Down Expand Up @@ -51,7 +51,7 @@ func init() {
buildInfo.Set(1)
kingpin.VersionFlag = kingpin.Flag("version", "Show the application version information").
Short('v').
PreAction(func(c *kingpin.ParseContext) error {
PreAction(func(_ *kingpin.ParseContext) error {
err := versionTmpl.Execute(os.Stdout, map[string]string{
"name": "do-agent",
"version": version,
Expand Down
78 changes: 45 additions & 33 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,49 +1,61 @@
module github.com/digitalocean/do-agent

go 1.18
go 1.22

require (
github.com/go-kit/kit v0.10.0
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.26.0
github.com/prometheus/node_exporter v1.0.1
github.com/prometheus/procfs v0.6.0
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/go-kit/kit v0.13.0
github.com/golang/snappy v0.0.4
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.53.0
github.com/prometheus/node_exporter v1.8.1
github.com/prometheus/procfs v0.14.0
github.com/stretchr/testify v1.9.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/beevik/ntp v0.3.0 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beevik/ntp v1.3.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ema/qdisc v0.0.0-20190904071900-b82c76788043 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/godbus/dbus v0.0.0-20190402143921-271e53dc4968 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/hodgesds/perf-utils v0.0.8 // indirect
github.com/lufia/iostat v1.1.0 // indirect
github.com/dennwc/btrfs v0.0.0-20240418142341-0167142bde7a // indirect
github.com/dennwc/ioctl v1.0.0 // indirect
github.com/ema/qdisc v1.0.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/go-envparse v0.1.0 // indirect
github.com/hodgesds/perf-utils v0.7.0 // indirect
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/jsimonetti/rtnetlink v1.4.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lufia/iostat v1.2.1 // indirect
github.com/mattn/go-xmlrpc v0.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mdlayher/genetlink v1.0.0 // indirect
github.com/mdlayher/netlink v1.1.0 // indirect
github.com/mdlayher/wifi v0.0.0-20190303161829-b1436901ddee // indirect
github.com/mdlayher/ethtool v0.1.0 // indirect
github.com/mdlayher/genetlink v1.3.2 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/mdlayher/wifi v0.1.0 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/siebenmann/go-kstat v0.0.0-20200303194639-4e8294f9e9d5 // indirect
github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a // indirect
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect
golang.org/x/sys v0.5.0 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
github.com/prometheus-community/go-runit v0.1.0 // indirect
github.com/safchain/ethtool v0.3.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v1.0.1 // indirect
)

replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
Loading