Skip to content

Commit

Permalink
Merge pull request #11 from fedepaol/fixci
Browse files Browse the repository at this point in the history
Adjust the CI and make the linters happy
  • Loading branch information
fedepaol authored Jun 23, 2023
2 parents 2ab423e + 003e137 commit eb6f38f
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 653 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
on:
merge_group:
pull_request:
paths-ignore:
- 'DCO'
- 'LICENSE'
- 'README.md'
Expand Down
1 change: 1 addition & 0 deletions .golangci.exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(github.com/go-kit/log.Logger).Log
53 changes: 53 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
run:
issues-exit-code: 2
linters:
enable:
- godot
- goimports
- gofmt
- ginkgolinter
- dogsled
- exportloopref
- gocritic
- misspell
- nolintlint
- stylecheck
- unconvert
- unparam
- whitespace
- revive
- unused
- wastedassign
linters-settings:
errcheck:
exclude: .golangci.exclude
godot:
scope: toplevel
capital: true
exclude:
- 'SPDX-License-Identifier.*'
- '\+groupName.*'
misspell:
locale: US
ignore-words:
- neighbours
- neighbour
stylecheck:
dot-import-whitelist:
- github.com/onsi/ginkgo
- github.com/onsi/gomega
gocritic:
disabled-checks:
- captLocal
- exitAfterDefer
revive:
rules:
- name: receiver-naming
disabled: true
- name: dot-imports
disabled: true
issues:
exclude-rules:
- path: 'api'
linters:
- stylecheck
10 changes: 5 additions & 5 deletions api/v1beta1/frrconfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// FRRConfigurationSpec defines the desired state of FRRConfiguration
// FRRConfigurationSpec defines the desired state of FRRConfiguration.
type FRRConfigurationSpec struct {
// +optional
BGP BGPConfig `json:"bgp,omitempty"`
Expand All @@ -38,7 +38,7 @@ type BGPConfig struct {
BFDProfiles []BFDProfile `json:"bfdProfiles,omitempty"`
}

// Router represent a neighbor router we want FRR to connect to
// Router represent a neighbor router we want FRR to connect to.
type Router struct {
// AS number to use for the local end of the session.
// +kubebuilder:validation:Minimum=0
Expand Down Expand Up @@ -221,7 +221,7 @@ type BFDProfile struct {
MinimumTTL uint32 `json:"minimumTtl,omitempty"`
}

// FRRConfigurationStatus defines the observed state of FRRConfiguration
// FRRConfigurationStatus defines the observed state of FRRConfiguration.
type FRRConfigurationStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
Expand All @@ -230,7 +230,7 @@ type FRRConfigurationStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// FRRConfiguration is the Schema for the frrconfigurations API
// FRRConfiguration is the Schema for the frrconfigurations API.
type FRRConfiguration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -241,7 +241,7 @@ type FRRConfiguration struct {

//+kubebuilder:object:root=true

// FRRConfigurationList contains a list of FRRConfiguration
// FRRConfigurationList contains a list of FRRConfiguration.
type FRRConfigurationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
)

var (
// GroupVersion is group version used to register these objects
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "frrk8s.metallb.io", Version: "v1beta1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
Expand Down
11 changes: 11 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
rules: {
// Ensure we have a blank line between the header and the body.
'body-leading-blank': [2, 'always'],
// Warn on lines longer than 72 chars. We usually don't want them for
// text, but links are fine if they exceed. So, just warn.
'body-max-line-length': [1, 'always', 72],
// Ensure the header line doesn't end with a period.
'header-full-stop': [2, 'never'],
},
};
26 changes: 12 additions & 14 deletions config/crd/bases/frrk8s.metallb.io_frrconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- name: v1beta1
schema:
openAPIV3Schema:
description: FRRConfiguration is the Schema for the frrconfigurations API
description: FRRConfiguration is the Schema for the frrconfigurations API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand All @@ -33,7 +33,7 @@ spec:
metadata:
type: object
spec:
description: FRRConfigurationSpec defines the desired state of FRRConfiguration
description: FRRConfigurationSpec defines the desired state of FRRConfiguration.
properties:
bgp:
properties:
Expand Down Expand Up @@ -110,7 +110,7 @@ spec:
per VRF).
items:
description: Router represent a neighbor router we want FRR
to connect to
to connect to.
properties:
asn:
description: AS number to use for the local end of the session.
Expand Down Expand Up @@ -204,17 +204,16 @@ spec:
withCommunity:
description: PrefixesWithCommunity is a list of
prefixes that are associated to a bgp community
when being advertised.
when being advertised. The prefixes associated
to a given local pref must be in the prefixes
allowed to be advertised.
items:
properties:
community:
type: string
prefixes:
description: Prefixes is the list of prefixes
associated to the community. They must
be defined in the router configuration
and the neighbor must be allowed to receive
them.
associated to the community.
format: cidr
items:
type: string
Expand All @@ -225,17 +224,16 @@ spec:
withLocalPref:
description: PrefixesWithLocalPref is a list of
prefixes that are associated to a local preference
when being advertised.
when being advertised. The prefixes associated
to a given local pref must be in the prefixes
allowed to be advertised.
items:
properties:
localPref:
type: integer
prefixes:
description: Prefixes is the list of prefixes
associated to the local preference. They
must be defined in the router configuration
and the neighbor must be allowed to receive
them.
associated to the local preference.
format: cidr
items:
type: string
Expand Down Expand Up @@ -295,7 +293,7 @@ spec:
type: object
type: object
status:
description: FRRConfigurationStatus defines the observed state of FRRConfiguration
description: FRRConfigurationStatus defines the observed state of FRRConfiguration.
type: object
type: object
served: true
Expand Down
66 changes: 4 additions & 62 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,125 +3,67 @@ module github.com/metallb/frrk8s
go 1.19

require (
github.com/go-kit/log v0.2.1
github.com/google/go-cmp v0.5.9
github.com/onsi/ginkgo/v2 v2.6.0
github.com/onsi/gomega v1.24.1
github.com/ory/dockertest/v3 v3.10.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
go.universe.tf/metallb v0.13.9
k8s.io/api v0.26.4
k8s.io/apimachinery v0.26.4
k8s.io/client-go v1.5.2
k8s.io/klog v1.0.0
k8s.io/kubernetes v1.26.1
k8s.io/pod-security-admission v0.0.0
sigs.k8s.io/controller-runtime v0.14.4
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.12+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // 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/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/openshift-kni/k8sreporter v1.0.2 // indirect
github.com/openshift/api v0.0.0-20200829102639-8a3a835f1acf // indirect
github.com/openshift/client-go v0.0.0-20200827190008-3062137373b5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cobra v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 // indirect
go.opentelemetry.io/otel v1.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
go.opentelemetry.io/otel/metric v0.31.0 // indirect
go.opentelemetry.io/otel/sdk v1.10.0 // indirect
go.opentelemetry.io/otel/trace v1.10.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 // indirect
google.golang.org/grpc v1.52.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/apiserver v0.26.0 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/component-helpers v0.26.0 // indirect
k8s.io/klog/v2 v2.90.0 // indirect
k8s.io/kube-openapi v0.0.0-20230123231816-1cb3ae25d79a // indirect
k8s.io/kubectl v0.0.0 // indirect
k8s.io/utils v0.0.0-20230115233650-391b47cb4029 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down Expand Up @@ -155,4 +97,4 @@ replace (
k8s.io/mount-utils => k8s.io/mount-utils v0.26.0
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.26.0
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.26.0
)
)
Loading

0 comments on commit eb6f38f

Please sign in to comment.