88 "testing"
99
1010 "github.com/stretchr/testify/require"
11- meta "k8s.io/apimachinery/pkg/api/meta"
12- "k8s.io/apimachinery/pkg/runtime/schema"
11+ meta "k8s.io/apimachinery/pkg/api/meta"
12+ "k8s.io/apimachinery/pkg/runtime/schema"
1313)
1414
1515const nncCRD = `{
@@ -161,10 +161,10 @@ const nncResult = `{
161161}`
162162
163163func staticNNCMapper () meta.RESTMapper {
164- gv := schema.GroupVersion {Group : "acn.azure.com" , Version : "v1alpha" }
165- m := meta .NewDefaultRESTMapper ([]schema.GroupVersion {gv })
166- m .Add (schema.GroupVersionKind {Group : gv .Group , Version : gv .Version , Kind : "NodeNetworkConfig" }, meta .RESTScopeNamespace )
167- return m
164+ gv := schema.GroupVersion {Group : "acn.azure.com" , Version : "v1alpha" }
165+ m := meta .NewDefaultRESTMapper ([]schema.GroupVersion {gv })
166+ m .Add (schema.GroupVersionKind {Group : gv .Group , Version : gv .Version , Kind : "NodeNetworkConfig" }, meta .RESTScopeNamespace )
167+ return m
168168}
169169
170170func TestNewHealthzHandlerWithChecks (t * testing.T ) {
@@ -178,7 +178,7 @@ func TestNewHealthzHandlerWithChecks(t *testing.T) {
178178 name : "list NNC gives 200 should indicate healthy" ,
179179 config : & Config {
180180 PingAPIServer : true ,
181- Mapper : staticNNCMapper (),
181+ Mapper : staticNNCMapper (),
182182 },
183183 apiStatusCode : http .StatusOK ,
184184 expectedHealthy : true ,
@@ -187,7 +187,7 @@ func TestNewHealthzHandlerWithChecks(t *testing.T) {
187187 name : "unauthorized (401) from apiserver should be unhealthy" ,
188188 config : & Config {
189189 PingAPIServer : true ,
190- Mapper : staticNNCMapper (),
190+ Mapper : staticNNCMapper (),
191191 },
192192 apiStatusCode : http .StatusUnauthorized ,
193193 expectedHealthy : false ,
@@ -196,7 +196,7 @@ func TestNewHealthzHandlerWithChecks(t *testing.T) {
196196 name : "channel nodesubnet should not call apiserver so it doesn't matter if the status code is a 401" ,
197197 config : & Config {
198198 PingAPIServer : false ,
199- Mapper : staticNNCMapper (),
199+ Mapper : staticNNCMapper (),
200200 },
201201 apiStatusCode : http .StatusUnauthorized ,
202202 expectedHealthy : true ,
0 commit comments