File tree Expand file tree Collapse file tree 7 files changed +20
-12
lines changed
imageregistries/credentials Expand file tree Collapse file tree 7 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ linters:
34
34
- staticcheck
35
35
- stylecheck
36
36
- tenv
37
+ - testifylint
37
38
- thelper
38
39
- tparallel
39
40
- unconvert
@@ -74,18 +75,20 @@ linters-settings:
74
75
- style
75
76
gofumpt :
76
77
extra-rules : true
78
+ importas :
79
+ no-unaliased : false
80
+ alias :
81
+ - pkg : " sigs.k8s.io/cluster-api/api/v1beta1"
82
+ alias : clusterv1
77
83
lll :
78
84
line-length : 120
79
85
stylecheck :
80
86
# https://staticcheck.io/docs/configuration/options/#dot_import_whitelist
81
87
dot-import-whitelist :
82
88
- github.com/onsi/ginkgo/v2
83
89
- github.com/onsi/gomega
84
- importas :
85
- no-unaliased : false
86
- alias :
87
- - pkg : " sigs.k8s.io/cluster-api/api/v1beta1"
88
- alias : clusterv1
90
+ testifylint :
91
+ enable-all : true
89
92
90
93
issues :
91
94
exclude-dirs :
Original file line number Diff line number Diff line change 7
7
"testing"
8
8
9
9
"github.com/stretchr/testify/assert"
10
+ "github.com/stretchr/testify/require"
10
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
12
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
12
13
)
@@ -90,7 +91,7 @@ func Test_templateValues(t *testing.T) {
90
91
for _ , tt := range tests {
91
92
t .Run (tt .name , func (t * testing.T ) {
92
93
got , err := templateValues (tt .cluster , tt .text )
93
- assert .NoError (t , err )
94
+ require .NoError (t , err )
94
95
assert .Equal (t , tt .want , got )
95
96
})
96
97
}
Original file line number Diff line number Diff line change 7
7
"testing"
8
8
9
9
"github.com/stretchr/testify/assert"
10
+ "github.com/stretchr/testify/require"
10
11
"sigs.k8s.io/cluster-api/api/v1beta1"
11
12
)
12
13
@@ -69,7 +70,7 @@ func Test_PodCIDR(t *testing.T) {
69
70
t .Run (tt .name , func (t * testing.T ) {
70
71
t .Parallel ()
71
72
cidr , err := PodCIDR (tt .cluster )
72
- assert .ErrorIs (t , err , tt .wantErr )
73
+ require .ErrorIs (t , err , tt .wantErr )
73
74
assert .Equal (t , tt .wantCIDR , cidr )
74
75
})
75
76
}
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ func Test_shouldDeleteServicesWithLoadBalancer(t *testing.T) {
103
103
t .Run (tt .name , func (t * testing.T ) {
104
104
t .Parallel ()
105
105
shouldDelete , err := shouldDeleteServicesWithLoadBalancer (tt .cluster )
106
- assert .NoError (t , err )
106
+ require .NoError (t , err )
107
107
assert .Equal (t , tt .shouldDelete , shouldDelete )
108
108
})
109
109
}
Original file line number Diff line number Diff line change 7
7
"testing"
8
8
9
9
"github.com/stretchr/testify/assert"
10
+ "github.com/stretchr/testify/require"
10
11
cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
11
12
)
12
13
@@ -80,7 +81,7 @@ providers:
80
81
t .Run (tt .name , func (t * testing.T ) {
81
82
t .Parallel ()
82
83
file , err := templateKubeletCredentialProviderConfig ()
83
- assert .ErrorIs (t , err , tt .wantErr )
84
+ require .ErrorIs (t , err , tt .wantErr )
84
85
assert .Equal (t , tt .want , file )
85
86
})
86
87
}
@@ -344,7 +345,7 @@ credentialProviders:
344
345
t .Run (tt .name , func (t * testing.T ) {
345
346
t .Parallel ()
346
347
file , err := templateDynamicCredentialProviderConfig (tt .credentials )
347
- assert .ErrorIs (t , err , tt .wantErr )
348
+ require .ErrorIs (t , err , tt .wantErr )
348
349
assert .Equal (t , tt .want , file )
349
350
})
350
351
}
Original file line number Diff line number Diff line change 9
9
. "github.com/onsi/ginkgo/v2"
10
10
"github.com/onsi/gomega"
11
11
"github.com/stretchr/testify/assert"
12
+ "github.com/stretchr/testify/require"
12
13
corev1 "k8s.io/api/core/v1"
13
14
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14
15
"k8s.io/apimachinery/pkg/runtime"
@@ -117,7 +118,7 @@ func Test_needImageRegistryCredentialsConfiguration(t *testing.T) {
117
118
t .Parallel ()
118
119
119
120
need , err := needImageRegistryCredentialsConfiguration (tt .configs )
120
- assert .ErrorIs (t , err , tt .wantErr )
121
+ require .ErrorIs (t , err , tt .wantErr )
121
122
assert .Equal (t , tt .need , need )
122
123
})
123
124
}
Original file line number Diff line number Diff line change 7
7
"testing"
8
8
9
9
"github.com/stretchr/testify/assert"
10
+ "github.com/stretchr/testify/require"
10
11
cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
11
12
12
13
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
@@ -92,7 +93,7 @@ func Test_generateDefaultRegistryMirrorFile(t *testing.T) {
92
93
t .Run (tt .name , func (t * testing.T ) {
93
94
t .Parallel ()
94
95
file , err := generateGlobalRegistryMirrorFile (tt .config )
95
- assert .ErrorIs (t , err , tt .wantErr )
96
+ require .ErrorIs (t , err , tt .wantErr )
96
97
assert .Equal (t , tt .want , file )
97
98
})
98
99
}
You can’t perform that action at this time.
0 commit comments