Skip to content

Commit

Permalink
enable tagliatelle linter
Browse files Browse the repository at this point in the history
Signed-off-by: Etai Lev Ran <[email protected]>
  • Loading branch information
elevran committed Jan 4, 2024
1 parent 0d55fe0 commit 5785695
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ linters:
- revive
- staticcheck
- stylecheck
# - tagliatelle
- tagliatelle
- tenv
- testableexamples
# - thelper
Expand Down
18 changes: 9 additions & 9 deletions cmd/gwctl/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ const (

// ClientConfig contain all Client configuration to send requests to the GW.
type ClientConfig struct {
GwIP string `json:"gwIP"`
GwPort uint16 `json:"gwPort"`
ID string `json:"ID"`
CaFile string `json:"CaFile"`
CertFile string `json:"CertFile"`
KeyFile string `json:"KeyFile"`
Dataplane string `json:"Dataplane"`
PolicyEngineIP string `json:"PolicyEngineIP"`
MetricsManagerIP string `json:"MetricsManagerIP"`
GwIP string `json:"gw_ip"`
GwPort uint16 `json:"gw_port"`
ID string `json:"id"`
CaFile string `json:"ca_file"`
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
Dataplane string `json:"dataplane"`
PolicyEngineIP string `json:"policy_engine_ip"`
MetricsManagerIP string `json:"metrics_manager_ip"`
logger *logrus.Entry `json:"-"`
}

Expand Down
1 change: 1 addition & 0 deletions pkg/policyengine/PolicyDispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func TestDisableEnablePeers(t *testing.T) {
require.Equal(t, peer1, connReqResp.TargetPeer) // peer1 was re-enabled, so it is now chosen again
}

//nolint:unparam // `svc` always receives `svcName` (allow passing other names in future)
func addRemoteSvc(t *testing.T, svc, peer string, ph policyengine.PolicyDecider) {
ph.AddPeer(peer) // just in case it was not already added
action, err := ph.AddBinding(&api.Binding{Spec: api.BindingSpec{Import: svc, Peer: peer}})
Expand Down
9 changes: 5 additions & 4 deletions pkg/policyengine/k8sshim/connectivity_policy_crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ type ConnectivityPolicy struct {

// ConnectivityPolicySpec is a common spec for both PrivilegedConnectivityPolicy and ConnectivityPolicy.
type ConnectivityPolicySpec struct {
Action policytypes.PolicyAction
From policytypes.WorkloadSetOrSelectorList `json:"from"`
To policytypes.WorkloadSetOrSelectorList `json:"to"`
ConnectionAttrs []ConnectionAttrs `json:"connectionAttrs,omitempty"`
Action policytypes.PolicyAction
From policytypes.WorkloadSetOrSelectorList `json:"from"`
To policytypes.WorkloadSetOrSelectorList `json:"to"`
//nolint:tagliatelle // use camelCase, same as k8s convention
ConnectionAttrs []ConnectionAttrs `json:"connectionAttrs,omitempty"`
}

// ConnectionAttrs describes the combination of protocol and port used by a given connection.
Expand Down
4 changes: 3 additions & 1 deletion pkg/policyengine/policytypes/connectivity_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ type WorkloadSetOrSelectorList []WorkloadSetOrSelector
// WorkloadSetOrSelector describes a set of workloads, based on their attributes (labels)
// Exactly one of the two fields should be non-empty.
type WorkloadSetOrSelector struct {
WorkloadSets []string `json:"workloadSets,omitempty"`
//nolint:tagliatelle // use camelCase, same as k8s convention
WorkloadSets []string `json:"workloadSets,omitempty"`
//nolint:tagliatelle // use camelCase, same as k8s convention
WorkloadSelector *metav1.LabelSelector `json:"workloadSelector,omitempty"`
}

Expand Down

0 comments on commit 5785695

Please sign in to comment.