mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #126080 from mmorel-35/testifylint/staging/src/k8s.io/cloud-provider
fix: enable testifylint on `staging/src/k8s.io/cloud-provider`
This commit is contained in:
commit
e61ae75936
@ -35,6 +35,7 @@ import (
|
|||||||
netutils "k8s.io/utils/net"
|
netutils "k8s.io/utils/net"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func alwaysReady() bool { return true }
|
func alwaysReady() bool { return true }
|
||||||
@ -439,7 +440,7 @@ func TestReconcile(t *testing.T) {
|
|||||||
informerFactory := informers.NewSharedInformerFactory(testCase.clientset, 0)
|
informerFactory := informers.NewSharedInformerFactory(testCase.clientset, 0)
|
||||||
rc := New(routes, testCase.clientset, informerFactory.Core().V1().Nodes(), cluster, cidrs)
|
rc := New(routes, testCase.clientset, informerFactory.Core().V1().Nodes(), cluster, cidrs)
|
||||||
rc.nodeListerSynced = alwaysReady
|
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() {
|
for _, action := range testCase.clientset.Actions() {
|
||||||
if action.GetVerb() == "update" && action.GetResource().Resource == "nodes" {
|
if action.GetVerb() == "update" && action.GetResource().Resource == "nodes" {
|
||||||
node := action.(core.UpdateAction).GetObject().(*v1.Node)
|
node := action.(core.UpdateAction).GetObject().(*v1.Node)
|
||||||
|
@ -40,6 +40,7 @@ import (
|
|||||||
netutils "k8s.io/utils/net"
|
netutils "k8s.io/utils/net"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDefaultFlags(t *testing.T) {
|
func TestDefaultFlags(t *testing.T) {
|
||||||
@ -370,14 +371,14 @@ func TestCreateConfig(t *testing.T) {
|
|||||||
"--webhook-secure-port=10300",
|
"--webhook-secure-port=10300",
|
||||||
}
|
}
|
||||||
err = fs.Parse(args)
|
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) {
|
fs.VisitAll(func(f *pflag.Flag) {
|
||||||
fmt.Printf("%s: %s\n", f.Name, f.Value)
|
fmt.Printf("%s: %s\n", f.Name, f.Value)
|
||||||
})
|
})
|
||||||
|
|
||||||
c, err := s.Config([]string{"foo", "bar"}, []string{}, nil, []string{"foo", "bar", "baz"}, []string{})
|
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{
|
expected := &appconfig.Config{
|
||||||
ComponentConfig: cpconfig.CloudControllerManagerConfiguration{
|
ComponentConfig: cpconfig.CloudControllerManagerConfiguration{
|
||||||
|
Loading…
Reference in New Issue
Block a user