mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
fix: enable testifylint on staging/src/k8s.io/cloud-provider
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
a15dca3765
commit
7d05570897
@ -35,6 +35,7 @@ import (
|
||||
netutils "k8s.io/utils/net"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func alwaysReady() bool { return true }
|
||||
@ -439,7 +440,7 @@ func TestReconcile(t *testing.T) {
|
||||
informerFactory := informers.NewSharedInformerFactory(testCase.clientset, 0)
|
||||
rc := New(routes, testCase.clientset, informerFactory.Core().V1().Nodes(), cluster, cidrs)
|
||||
rc.nodeListerSynced = alwaysReady
|
||||
assert.NoError(t, rc.reconcile(ctx, testCase.nodes, testCase.initialRoutes), "failed to reconcile")
|
||||
require.NoError(t, rc.reconcile(ctx, testCase.nodes, testCase.initialRoutes), "failed to reconcile")
|
||||
for _, action := range testCase.clientset.Actions() {
|
||||
if action.GetVerb() == "update" && action.GetResource().Resource == "nodes" {
|
||||
node := action.(core.UpdateAction).GetObject().(*v1.Node)
|
||||
|
@ -40,6 +40,7 @@ import (
|
||||
netutils "k8s.io/utils/net"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDefaultFlags(t *testing.T) {
|
||||
@ -370,14 +371,14 @@ func TestCreateConfig(t *testing.T) {
|
||||
"--webhook-secure-port=10300",
|
||||
}
|
||||
err = fs.Parse(args)
|
||||
assert.Nil(t, err, "unexpected error: %s", err)
|
||||
require.NoError(t, err, "unexpected error: %s", err)
|
||||
|
||||
fs.VisitAll(func(f *pflag.Flag) {
|
||||
fmt.Printf("%s: %s\n", f.Name, f.Value)
|
||||
})
|
||||
|
||||
c, err := s.Config([]string{"foo", "bar"}, []string{}, nil, []string{"foo", "bar", "baz"}, []string{})
|
||||
assert.Nil(t, err, "unexpected error: %s", err)
|
||||
require.NoError(t, err, "unexpected error: %s", err)
|
||||
|
||||
expected := &appconfig.Config{
|
||||
ComponentConfig: cpconfig.CloudControllerManagerConfiguration{
|
||||
|
Loading…
Reference in New Issue
Block a user