Address linter failures
This commit is contained in:
1 parent
f73355abcc
commit
915638d17a
3 files changed
+5
-5
No files matched your search
@@ -494,7 +494,7 @@ func TestTransfer(t *testing.T) {
|
|||||||
ring1.ClaimItAll()
|
ring1.ClaimItAll()
|
||||||
ring1.GrantRangeToHost(middle, end, peer2name)
|
ring1.GrantRangeToHost(middle, end, peer2name)
|
||||||
ring1.Transfer(peer2name, peer1name)
|
ring1.Transfer(peer2name, peer1name)
|
||||||
require.Equal(t, []address.Range{{start, middle}, {middle, end}}, ring1.OwnedRanges())
|
require.Equal(t, []address.Range{{Start: start, End: middle}, {Start: middle, End: end}}, ring1.OwnedRanges())
|
||||||
|
|
||||||
// Second test is what happens when a token exists at the end of a range but is transferred
|
// Second test is what happens when a token exists at the end of a range but is transferred
|
||||||
// - does it get resurrected correctly?
|
// - does it get resurrected correctly?
|
||||||
@@ -503,7 +503,7 @@ func TestTransfer(t *testing.T) {
|
|||||||
ring1.GrantRangeToHost(middle, end, peer2name)
|
ring1.GrantRangeToHost(middle, end, peer2name)
|
||||||
ring1.Transfer(peer2name, peer1name)
|
ring1.Transfer(peer2name, peer1name)
|
||||||
ring1.GrantRangeToHost(dot10, middle, peer2name)
|
ring1.GrantRangeToHost(dot10, middle, peer2name)
|
||||||
require.Equal(t, []address.Range{{start, dot10}, {middle, end}}, ring1.OwnedRanges())
|
require.Equal(t, []address.Range{{Start: start, End: dot10}, {Start: middle, End: end}}, ring1.OwnedRanges())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOwner(t *testing.T) {
|
func TestOwner(t *testing.T) {
|
||||||
|
|||||||
+2
-2
@@ -319,13 +319,13 @@ func equals(a, b map[string]string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isDefaultDeny(namespace *coreapi.Namespace) bool {
|
func isDefaultDeny(namespace *coreapi.Namespace) bool {
|
||||||
nnpJson, found := namespace.ObjectMeta.Annotations["net.beta.kubernetes.io/network-policy"]
|
nnpJSON, found := namespace.ObjectMeta.Annotations["net.beta.kubernetes.io/network-policy"]
|
||||||
if !found {
|
if !found {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var nnp NamespaceNetworkPolicy
|
var nnp NamespaceNetworkPolicy
|
||||||
if err := json.Unmarshal([]byte(nnpJson), &nnp); err != nil {
|
if err := json.Unmarshal([]byte(nnpJSON), &nnp); err != nil {
|
||||||
log.Warn("Ignoring network policy annotation: unmarshal failed:", err)
|
log.Warn("Ignoring network policy annotation: unmarshal failed:", err)
|
||||||
// If we can't understand the annotation, behave as if it isn't present
|
// If we can't understand the annotation, behave as if it isn't present
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func uint64Counter(desc *prometheus.Desc, val uint64, labels ...string) promethe
|
|||||||
return prometheus.MustNewConstMetric(desc, prometheus.CounterValue, float64(val), labels...)
|
return prometheus.MustNewConstMetric(desc, prometheus.CounterValue, float64(val), labels...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var metrics []metric = []metric{
|
var metrics = []metric{
|
||||||
{desc("weave_connections", "Number of peer-to-peer connections.", "state"),
|
{desc("weave_connections", "Number of peer-to-peer connections.", "state"),
|
||||||
func(s WeaveStatus, desc *prometheus.Desc, ch chan<- prometheus.Metric) {
|
func(s WeaveStatus, desc *prometheus.Desc, ch chan<- prometheus.Metric) {
|
||||||
counts := make(map[string]int)
|
counts := make(map[string]int)
|
||||||
|
|||||||
Reference in new issue
Block a user