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

Revert "Fix all the linter checks" #50

Merged
merged 2 commits into from
Jan 14, 2025
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 0 additions & 176 deletions .golangci.yaml

This file was deleted.

1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ LABEL source_repository="https://github.com/sapcc/kube-parrot"

WORKDIR /
COPY --from=builder /workspace/parrot .
USER 65532:65532

ENTRYPOINT ["/parrot"]
4 changes: 2 additions & 2 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ golang:
setGoModVersion: true

golangciLint:
createConfig: true
createConfig: false

githubWorkflow:
ci:
Expand All @@ -38,4 +38,4 @@ renovate:
- defo89
- SchwarzM
- xsen84
- goerangudat
- goerangudat
27 changes: 13 additions & 14 deletions cmd/parrot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ import (
"time"

"github.com/golang/glog"
"github.com/sapcc/go-bits/must"
"github.com/sapcc/go-traceroute/traceroute"
flag "github.com/spf13/pflag"
"golang.org/x/net/context"

"github.com/sapcc/kube-parrot/pkg/metrics"
"github.com/sapcc/kube-parrot/pkg/parrot"
flag "github.com/spf13/pflag"
"golang.org/x/net/context"
)

type Neighbors []*net.IP
Expand All @@ -29,8 +27,8 @@ var opts parrot.Options
var neighbors Neighbors

func init() {
flag.Uint32Var(&opts.As, "as", 65000, "local BGP ASN")
flag.Uint32Var(&opts.RemoteAs, "remote-as", 0, "remote BGP ASN. Default to local ASN (iBGP)")
flag.IntVar(&opts.As, "as", 65000, "local BGP ASN")
flag.IntVar(&opts.RemoteAs, "remote-as", 0, "remote BGP ASN. Default to local ASN (iBGP)")
flag.StringVar(&opts.NodeName, "nodename", "", "Name of the node this pod is running on")
flag.IPVar(&opts.HostIP, "hostip", net.ParseIP("127.0.0.1"), "IP")
flag.IntVar(&opts.MetricsPort, "metric-port", 30039, "Port for Prometheus metrics")
Expand All @@ -41,7 +39,7 @@ func init() {
}

func main() {
must.Succeed(goflag.CommandLine.Parse([]string{}))
goflag.CommandLine.Parse([]string{})
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
flag.Parse()

Expand Down Expand Up @@ -73,21 +71,21 @@ func main() {
glog.V(2).Infof("Shutdown Completed. Bye!")
}

func (n *Neighbors) String() string {
return fmt.Sprintf("%v", *n)
func (f *Neighbors) String() string {
return fmt.Sprintf("%v", *f)
}

func (n *Neighbors) Set(value string) error {
func (i *Neighbors) Set(value string) error {
ip := net.ParseIP(value)
if ip == nil {
return fmt.Errorf("%v is not a valid IP address", value)
}

*n = append(*n, &ip)
*i = append(*i, &ip)
return nil
}

func (n *Neighbors) Type() string {
func (s *Neighbors) Type() string {
return "neighborSlice"
}

Expand All @@ -105,9 +103,10 @@ func getNeighbors() []*net.IP {
defer t.Close()

h := make(map[string]struct{})
for i := range opts.TraceCount {
for i := 0; i < opts.TraceCount; i++ {
dst := fmt.Sprintf("1.1.1.%v", i)
err := t.Trace(context.Background(), net.ParseIP(dst), func(reply *traceroute.Reply) {

h[reply.IP.String()] = struct{}{}
})
if err != nil {
Expand All @@ -116,7 +115,7 @@ func getNeighbors() []*net.IP {
}

var neigh []*net.IP
for k := range h {
for k, _ := range h {
ip := net.ParseIP(k)
neigh = append(neigh, &ip)
}
Expand Down
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ require (
github.com/golang/glog v1.2.2
github.com/juju/ratelimit v1.0.2
github.com/osrg/gobgp v0.0.0-20180701120657-8e6bd4c7145d
github.com/prometheus/client_golang v1.20.5
github.com/sapcc/go-bits v0.0.0-20250110100829-6bde0afe3f09
github.com/prometheus/client_golang v1.20.4
github.com/sapcc/go-traceroute v0.0.0-20210130143923-d034613e85fc
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.33.0
Expand Down Expand Up @@ -46,13 +45,13 @@ require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/satori/go.uuid v0.0.0-20180103174451-36e9d2ebbde5 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
Expand All @@ -64,14 +63,14 @@ require (
github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 // indirect
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.35.2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/tomb.v2 v2.0.0-20140626144623-14b3d72120e8 // indirect
Expand Down
Loading
Loading