mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
fix: enable error-nil and nil-compare rules from testifylint in module k8s.io/client-go
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
a8c955ab42
commit
71ced25f44
@ -19,12 +19,12 @@ package testing
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"sigs.k8s.io/structured-merge-diff/v4/typed"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"sigs.k8s.io/structured-merge-diff/v4/typed"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/api/errors"
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
@ -450,7 +450,7 @@ func TestGetWithExactMatch(t *testing.T) {
|
|||||||
nodeResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "node"}
|
nodeResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "node"}
|
||||||
node, gvr := constructObject(nodeResource, "node", "")
|
node, gvr := constructObject(nodeResource, "node", "")
|
||||||
|
|
||||||
assert.Nil(t, o.Add(node))
|
assert.NoError(t, o.Add(node))
|
||||||
|
|
||||||
// Exact match
|
// Exact match
|
||||||
_, err = o.Get(gvr, "", "node")
|
_, err = o.Get(gvr, "", "node")
|
||||||
@ -466,7 +466,7 @@ func TestGetWithExactMatch(t *testing.T) {
|
|||||||
o = NewObjectTracker(scheme, codecs.UniversalDecoder())
|
o = NewObjectTracker(scheme, codecs.UniversalDecoder())
|
||||||
podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pod"}
|
podResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pod"}
|
||||||
pod, gvr := constructObject(podResource, "pod", "default")
|
pod, gvr := constructObject(podResource, "pod", "default")
|
||||||
assert.Nil(t, o.Add(pod))
|
assert.NoError(t, o.Add(pod))
|
||||||
|
|
||||||
// Exact match
|
// Exact match
|
||||||
_, err = o.Get(gvr, "default", "pod")
|
_, err = o.Get(gvr, "default", "pod")
|
||||||
|
Loading…
Reference in New Issue
Block a user