Skip to content

Commit 7d05570

Browse files
committed
fix: enable testifylint on staging/src/k8s.io/cloud-provider
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent a15dca3 commit 7d05570

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

staging/src/k8s.io/cloud-provider/controllers/route/route_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
netutils "k8s.io/utils/net"
3636

3737
"github.com/stretchr/testify/assert"
38+
"github.com/stretchr/testify/require"
3839
)
3940

4041
func alwaysReady() bool { return true }
@@ -439,7 +440,7 @@ func TestReconcile(t *testing.T) {
439440
informerFactory := informers.NewSharedInformerFactory(testCase.clientset, 0)
440441
rc := New(routes, testCase.clientset, informerFactory.Core().V1().Nodes(), cluster, cidrs)
441442
rc.nodeListerSynced = alwaysReady
442-
assert.NoError(t, rc.reconcile(ctx, testCase.nodes, testCase.initialRoutes), "failed to reconcile")
443+
require.NoError(t, rc.reconcile(ctx, testCase.nodes, testCase.initialRoutes), "failed to reconcile")
443444
for _, action := range testCase.clientset.Actions() {
444445
if action.GetVerb() == "update" && action.GetResource().Resource == "nodes" {
445446
node := action.(core.UpdateAction).GetObject().(*v1.Node)

staging/src/k8s.io/cloud-provider/options/options_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040
netutils "k8s.io/utils/net"
4141

4242
"github.com/stretchr/testify/assert"
43+
"github.com/stretchr/testify/require"
4344
)
4445

4546
func TestDefaultFlags(t *testing.T) {
@@ -370,14 +371,14 @@ func TestCreateConfig(t *testing.T) {
370371
"--webhook-secure-port=10300",
371372
}
372373
err = fs.Parse(args)
373-
assert.Nil(t, err, "unexpected error: %s", err)
374+
require.NoError(t, err, "unexpected error: %s", err)
374375

375376
fs.VisitAll(func(f *pflag.Flag) {
376377
fmt.Printf("%s: %s\n", f.Name, f.Value)
377378
})
378379

379380
c, err := s.Config([]string{"foo", "bar"}, []string{}, nil, []string{"foo", "bar", "baz"}, []string{})
380-
assert.Nil(t, err, "unexpected error: %s", err)
381+
require.NoError(t, err, "unexpected error: %s", err)
381382

382383
expected := &appconfig.Config{
383384
ComponentConfig: cpconfig.CloudControllerManagerConfiguration{

0 commit comments

Comments
 (0)