Skip to content

Commit 03409cd

Browse files
Merge pull request #123770 from Jefftree/go-restful
fix aggregator path filtering to include / Kubernetes-commit: 46f017a90b54b5abfc0a66a6ecf19e304aa7da95
2 parents 0484f16 + 0ff135f commit 03409cd

File tree

4 files changed

+65
-73
lines changed

4 files changed

+65
-73
lines changed

go.mod

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ require (
1313
github.com/spf13/pflag v1.0.5
1414
github.com/stretchr/testify v1.8.4
1515
golang.org/x/net v0.21.0
16-
k8s.io/api v0.0.0-20240306165540-05aa4bceed70
17-
k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5
18-
k8s.io/apiserver v0.0.0-20240306172940-17663913a4fd
19-
k8s.io/client-go v0.0.0-20240306170515-0cdc0ce850af
20-
k8s.io/code-generator v0.0.0-20240306171749-c9df80eb5e54
16+
k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f
17+
k8s.io/apimachinery v0.0.0-20240307160843-0407311be590
18+
k8s.io/apiserver v0.0.0-20240307053455-8763b7fa93af
19+
k8s.io/client-go v0.0.0-20240307050516-47abbe025115
20+
k8s.io/code-generator v0.0.0-20240327163807-71421176fc0e
2121
k8s.io/component-base v0.0.0-20240306172020-b0a6e40497ae
2222
k8s.io/klog/v2 v2.120.1
2323
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
@@ -105,18 +105,8 @@ require (
105105
gopkg.in/yaml.v2 v2.4.0 // indirect
106106
gopkg.in/yaml.v3 v3.0.1 // indirect
107107
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
108-
k8s.io/kms v0.0.0-20240306172340-03c9a46c21c7 // indirect
108+
k8s.io/kms v0.0.0-20240327165525-6bf80055228c // indirect
109109
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect
110110
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
111111
sigs.k8s.io/yaml v1.3.0 // indirect
112112
)
113-
114-
replace (
115-
k8s.io/api => k8s.io/api v0.0.0-20240306165540-05aa4bceed70
116-
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5
117-
k8s.io/apiserver => k8s.io/apiserver v0.0.0-20240306172940-17663913a4fd
118-
k8s.io/client-go => k8s.io/client-go v0.0.0-20240306170515-0cdc0ce850af
119-
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20240306171749-c9df80eb5e54
120-
k8s.io/component-base => k8s.io/component-base v0.0.0-20240306172020-b0a6e40497ae
121-
k8s.io/kms => k8s.io/kms v0.0.0-20240306172340-03c9a46c21c7
122-
)

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -292,24 +292,24 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
292292
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
293293
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
294294
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
295-
k8s.io/api v0.0.0-20240306165540-05aa4bceed70 h1:Kw6GufAvqr668v56lckDWoGHFG5wwjQRjYuf+PMt1us=
296-
k8s.io/api v0.0.0-20240306165540-05aa4bceed70/go.mod h1:S69aw/5045kbDeBVmy89EQxSM7v5kHdLNzO4wt3OZ2o=
297-
k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 h1:YRP8FbAab9hlobsEfyUG7P6dC6hbVTLw0eFY/AnewmY=
298-
k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y=
299-
k8s.io/apiserver v0.0.0-20240306172940-17663913a4fd h1:epNppmSMUuJL2TpEKJN9mGdipws7IAsRp4wHozRLnmI=
300-
k8s.io/apiserver v0.0.0-20240306172940-17663913a4fd/go.mod h1:St1PmKeeAHl34HIFGJMPbD+sNLyXk4bRNv1ptaHPOg8=
301-
k8s.io/client-go v0.0.0-20240306170515-0cdc0ce850af h1:hU8WcNO9vZrUXLzKbyXj6FUlMuTecjBr7MmbGxfCkzM=
302-
k8s.io/client-go v0.0.0-20240306170515-0cdc0ce850af/go.mod h1:g+S/ljjD+b0SS7OkKeZ6IBio03Ot9Q8s19hN3jHsl/Y=
303-
k8s.io/code-generator v0.0.0-20240306171749-c9df80eb5e54 h1:BooyL7i5YIYtXh4lUUDJ7d8qaFy/PFf+WvRSOK3UCrE=
304-
k8s.io/code-generator v0.0.0-20240306171749-c9df80eb5e54/go.mod h1:gmJp+Ea+u8C4QlTlnkVtViOIsQKlpDCtC6zjiJaGCrc=
295+
k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f h1:AZBD10PF/cNxYJJgh8fMrENM3UItvPkMO18LB0dTrV8=
296+
k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f/go.mod h1:qUUt5cHNc6u/2o6gcfyGSFTAK8Ca4QD40QqESHedUoc=
297+
k8s.io/apimachinery v0.0.0-20240307160843-0407311be590 h1:YFg0j+PVfNLayHtZ3gdTeW12q7HECwhvZm9fWZpXyXo=
298+
k8s.io/apimachinery v0.0.0-20240307160843-0407311be590/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y=
299+
k8s.io/apiserver v0.0.0-20240307053455-8763b7fa93af h1:t14mpLj8FMKgkyGchVjIIq7RwowDSPuxw5os6m5hc00=
300+
k8s.io/apiserver v0.0.0-20240307053455-8763b7fa93af/go.mod h1:HmmYDBhRoIbxko8OQcZG4K/ZPSY5cAcH1+c10kAKSyo=
301+
k8s.io/client-go v0.0.0-20240307050516-47abbe025115 h1:5Dke+PgLxm5vHD81IKNgBvtlHJtU/lCE2S/ogshkics=
302+
k8s.io/client-go v0.0.0-20240307050516-47abbe025115/go.mod h1:FOGFrZsYXNQPOpNFNqdr723jdHoEbjA71a1HGcj+2s8=
303+
k8s.io/code-generator v0.0.0-20240327163807-71421176fc0e h1:zlsfzK9qpxCp2ahp494MTOUM0uxV8X5YaG4hfbtbcXI=
304+
k8s.io/code-generator v0.0.0-20240327163807-71421176fc0e/go.mod h1:0VAoUbzMRwLcq5yON5v0Dv5ZX4OlSKp1Lj02Opwv4iA=
305305
k8s.io/component-base v0.0.0-20240306172020-b0a6e40497ae h1:/bnYoyvHvOnxGRpKc3z/RG0R/gzUwIFg2zKk8UkVchM=
306306
k8s.io/component-base v0.0.0-20240306172020-b0a6e40497ae/go.mod h1:xHRknJm8Q13BCZjYtVCjnJJEzKC9RMj6OqPgtPWU8yI=
307307
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
308308
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
309309
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
310310
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
311-
k8s.io/kms v0.0.0-20240306172340-03c9a46c21c7 h1:v9feiZ9mQnGuvoKR8FkDM/2yuptz78hIiFIGJrhY5oA=
312-
k8s.io/kms v0.0.0-20240306172340-03c9a46c21c7/go.mod h1:Z8nrOW3UFa7WlN70KZvdbXOibJlhHr8pXAoqfjO/Owk=
311+
k8s.io/kms v0.0.0-20240327165525-6bf80055228c h1:3xRskaoHe8gjLIIeH+2V800bl6ZluP67+88BlneBF0w=
312+
k8s.io/kms v0.0.0-20240327165525-6bf80055228c/go.mod h1:Z8nrOW3UFa7WlN70KZvdbXOibJlhHr8pXAoqfjO/Owk=
313313
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
314314
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
315315
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=

pkg/controllers/openapi/aggregator/aggregator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (s *specAggregator) updateServiceLocked(name string) error {
199199
}
200200
group := specInfo.apiService.Spec.Group
201201
version := specInfo.apiService.Spec.Version
202-
return aggregator.FilterSpecByPathsWithoutSideEffects(result, []string{"/apis/" + group + "/" + version}), etag, nil
202+
return aggregator.FilterSpecByPathsWithoutSideEffects(result, []string{"/apis/" + group + "/" + version + "/"}), etag, nil
203203
}, cached.Result[*spec.Swagger]{Value: result, Etag: etag, Err: err})
204204
specInfo.spec.Store(filteredResult)
205205
return err

pkg/controllers/openapi/aggregator/aggregator_test.go

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestBasicPathsMerged(t *testing.T) {
3939
SwaggerProps: spec.SwaggerProps{
4040
Paths: &spec.Paths{
4141
Paths: map[string]spec.PathItem{
42-
"/apis/foo/v1": {},
42+
"/apis/foo/v1/": {},
4343
},
4444
},
4545
},
@@ -52,8 +52,8 @@ func TestBasicPathsMerged(t *testing.T) {
5252
if err != nil {
5353
t.Error(err)
5454
}
55-
expectPath(t, swagger, "/apis/foo/v1")
56-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
55+
expectPath(t, swagger, "/apis/foo/v1/")
56+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
5757
}
5858

5959
func TestAddUpdateAPIService(t *testing.T) {
@@ -103,7 +103,7 @@ func TestAddUpdateAPIService(t *testing.T) {
103103
}
104104

105105
expectPath(t, swagger, "/apis/apiservicegroup/v1/path1")
106-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
106+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
107107

108108
t.Log("Update APIService OpenAPI")
109109
handler.openapi = &spec.Swagger{
@@ -127,7 +127,7 @@ func TestAddUpdateAPIService(t *testing.T) {
127127
// aggregated OpenAPI is also updated.
128128
expectPath(t, swagger, "/apis/apiservicegroup/v1/path2")
129129
expectNoPath(t, swagger, "/apis/apiservicegroup/v1/path1")
130-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
130+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
131131
}
132132

133133
// Tests that an APIService that registers OpenAPI will only have the OpenAPI
@@ -140,7 +140,7 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) {
140140
SwaggerProps: spec.SwaggerProps{
141141
Paths: &spec.Paths{
142142
Paths: map[string]spec.PathItem{
143-
"/apis/foo/v1": {},
143+
"/apis/foo/v1/": {},
144144
},
145145
},
146146
},
@@ -171,7 +171,8 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) {
171171
SwaggerProps: spec.SwaggerProps{
172172
Paths: &spec.Paths{
173173
Paths: map[string]spec.PathItem{
174-
"/apis/apiservicegroup/v1": {},
174+
"/apis/apiservicegroup/v1/": {},
175+
"/apis/apiservicegroup/v1beta1/": {},
175176
},
176177
},
177178
},
@@ -181,9 +182,9 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) {
181182
SwaggerProps: spec.SwaggerProps{
182183
Paths: &spec.Paths{
183184
Paths: map[string]spec.PathItem{
184-
"/apis/a": {},
185-
"/apis/apiservicegroup/v1": {},
186-
"/apis/apiservicegroup/v2": {},
185+
"/apis/a/": {},
186+
"/apis/apiservicegroup/v1/": {},
187+
"/apis/apiservicegroup/v2/": {},
187188
},
188189
},
189190
},
@@ -207,10 +208,11 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) {
207208
if err != nil {
208209
t.Error(err)
209210
}
210-
expectPath(t, swagger, "/apis/apiservicegroup/v1")
211-
expectPath(t, swagger, "/apis/apiservicegroup/v2")
212-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
213-
expectNoPath(t, swagger, "/apis/a")
211+
expectPath(t, swagger, "/apis/apiservicegroup/v1/")
212+
expectPath(t, swagger, "/apis/apiservicegroup/v2/")
213+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
214+
expectNoPath(t, swagger, "/apis/a/")
215+
expectNoPath(t, swagger, "/apis/apiservicegroup/v1beta1/")
214216

215217
t.Logf("Remove APIService %s", apiService.Name)
216218
s.RemoveAPIService(apiService.Name)
@@ -221,7 +223,7 @@ func TestAPIServiceOpenAPIServiceMismatch(t *testing.T) {
221223
}
222224
// Ensure that the if the APIService is added then removed, the OpenAPI disappears from the aggregated OpenAPI as well.
223225
expectNoPath(t, swagger, "/apis/apiservicegroup/v1")
224-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
226+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
225227
expectNoPath(t, swagger, "/apis/a")
226228
}
227229

@@ -232,7 +234,7 @@ func TestAddRemoveAPIService(t *testing.T) {
232234
SwaggerProps: spec.SwaggerProps{
233235
Paths: &spec.Paths{
234236
Paths: map[string]spec.PathItem{
235-
"/apis/foo/v1": {},
237+
"/apis/foo/v1/": {},
236238
},
237239
},
238240
},
@@ -254,7 +256,7 @@ func TestAddRemoveAPIService(t *testing.T) {
254256
SwaggerProps: spec.SwaggerProps{
255257
Paths: &spec.Paths{
256258
Paths: map[string]spec.PathItem{
257-
"/apis/apiservicegroup/v1": {},
259+
"/apis/apiservicegroup/v1/": {},
258260
},
259261
},
260262
},
@@ -271,8 +273,8 @@ func TestAddRemoveAPIService(t *testing.T) {
271273
if err != nil {
272274
t.Error(err)
273275
}
274-
expectPath(t, swagger, "/apis/apiservicegroup/v1")
275-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
276+
expectPath(t, swagger, "/apis/apiservicegroup/v1/")
277+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
276278

277279
t.Logf("Remove APIService %s", apiService.Name)
278280
s.RemoveAPIService(apiService.Name)
@@ -282,8 +284,8 @@ func TestAddRemoveAPIService(t *testing.T) {
282284
t.Error(err)
283285
}
284286
// Ensure that the if the APIService is added then removed, the OpenAPI disappears from the aggregated OpenAPI as well.
285-
expectNoPath(t, swagger, "/apis/apiservicegroup/v1")
286-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
287+
expectNoPath(t, swagger, "/apis/apiservicegroup/v1/")
288+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
287289
}
288290

289291
func TestUpdateAPIService(t *testing.T) {
@@ -293,7 +295,7 @@ func TestUpdateAPIService(t *testing.T) {
293295
SwaggerProps: spec.SwaggerProps{
294296
Paths: &spec.Paths{
295297
Paths: map[string]spec.PathItem{
296-
"/apis/foo/v1": {},
298+
"/apis/foo/v1/": {},
297299
},
298300
},
299301
},
@@ -315,7 +317,7 @@ func TestUpdateAPIService(t *testing.T) {
315317
SwaggerProps: spec.SwaggerProps{
316318
Paths: &spec.Paths{
317319
Paths: map[string]spec.PathItem{
318-
"/apis/apiservicegroup/v1": {},
320+
"/apis/apiservicegroup/v1/": {},
319321
},
320322
},
321323
},
@@ -340,8 +342,8 @@ func TestUpdateAPIService(t *testing.T) {
340342
if err != nil {
341343
t.Error(err)
342344
}
343-
expectPath(t, swagger, "/apis/apiservicegroup/v1")
344-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
345+
expectPath(t, swagger, "/apis/apiservicegroup/v1/")
346+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
345347

346348
t.Logf("Updating APIService %s", apiService.Name)
347349
if err := s.AddUpdateAPIService(apiService, handler2); err != nil {
@@ -356,8 +358,8 @@ func TestUpdateAPIService(t *testing.T) {
356358
t.Error(err)
357359
}
358360
// Ensure that the if the APIService is added and then handler is modified, the new data is reflected in the aggregated OpenAPI.
359-
expectNoPath(t, swagger, "/apis/apiservicegroup/v1")
360-
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1")
361+
expectNoPath(t, swagger, "/apis/apiservicegroup/v1/")
362+
expectPath(t, swagger, "/apis/apiregistration.k8s.io/v1/")
361363
}
362364

363365
func TestFailingAPIServiceSkippedAggregation(t *testing.T) {
@@ -367,7 +369,7 @@ func TestFailingAPIServiceSkippedAggregation(t *testing.T) {
367369
SwaggerProps: spec.SwaggerProps{
368370
Paths: &spec.Paths{
369371
Paths: map[string]spec.PathItem{
370-
"/apis/foo/v1": {},
372+
"/apis/foo/v1/": {},
371373
},
372374
},
373375
},
@@ -391,7 +393,7 @@ func TestFailingAPIServiceSkippedAggregation(t *testing.T) {
391393
SwaggerProps: spec.SwaggerProps{
392394
Paths: &spec.Paths{
393395
Paths: map[string]spec.PathItem{
394-
"/apis/failed/v1": {},
396+
"/apis/failed/v1/": {},
395397
},
396398
},
397399
},
@@ -412,7 +414,7 @@ func TestFailingAPIServiceSkippedAggregation(t *testing.T) {
412414
SwaggerProps: spec.SwaggerProps{
413415
Paths: &spec.Paths{
414416
Paths: map[string]spec.PathItem{
415-
"/apis/success/v1": {},
417+
"/apis/success/v1/": {},
416418
},
417419
},
418420
},
@@ -437,9 +439,9 @@ func TestFailingAPIServiceSkippedAggregation(t *testing.T) {
437439
if err != nil {
438440
t.Error(err)
439441
}
440-
expectPath(t, swagger, "/apis/foo/v1")
441-
expectNoPath(t, swagger, "/apis/failed/v1")
442-
expectPath(t, swagger, "/apis/success/v1")
442+
expectPath(t, swagger, "/apis/foo/v1/")
443+
expectNoPath(t, swagger, "/apis/failed/v1/")
444+
expectPath(t, swagger, "/apis/success/v1/")
443445
}
444446

445447
func TestAPIServiceFailSuccessTransition(t *testing.T) {
@@ -449,7 +451,7 @@ func TestAPIServiceFailSuccessTransition(t *testing.T) {
449451
SwaggerProps: spec.SwaggerProps{
450452
Paths: &spec.Paths{
451453
Paths: map[string]spec.PathItem{
452-
"/apis/foo/v1": {},
454+
"/apis/foo/v1/": {},
453455
},
454456
},
455457
},
@@ -473,7 +475,7 @@ func TestAPIServiceFailSuccessTransition(t *testing.T) {
473475
SwaggerProps: spec.SwaggerProps{
474476
Paths: &spec.Paths{
475477
Paths: map[string]spec.PathItem{
476-
"/apis/apiservicegroup/v1": {},
478+
"/apis/apiservicegroup/v1/": {},
477479
},
478480
},
479481
},
@@ -491,8 +493,8 @@ func TestAPIServiceFailSuccessTransition(t *testing.T) {
491493
if err != nil {
492494
t.Error(err)
493495
}
494-
expectPath(t, swagger, "/apis/foo/v1")
495-
expectNoPath(t, swagger, "/apis/apiservicegroup/v1")
496+
expectPath(t, swagger, "/apis/foo/v1/")
497+
expectNoPath(t, swagger, "/apis/apiservicegroup/v1/")
496498

497499
t.Log("Transition APIService to not return error")
498500
handler.returnErr = false
@@ -504,8 +506,8 @@ func TestAPIServiceFailSuccessTransition(t *testing.T) {
504506
if err != nil {
505507
t.Error(err)
506508
}
507-
expectPath(t, swagger, "/apis/foo/v1")
508-
expectPath(t, swagger, "/apis/apiservicegroup/v1")
509+
expectPath(t, swagger, "/apis/foo/v1/")
510+
expectPath(t, swagger, "/apis/apiservicegroup/v1/")
509511
}
510512

511513
func TestFailingAPIServiceDoesNotBlockAdd(t *testing.T) {
@@ -515,7 +517,7 @@ func TestFailingAPIServiceDoesNotBlockAdd(t *testing.T) {
515517
SwaggerProps: spec.SwaggerProps{
516518
Paths: &spec.Paths{
517519
Paths: map[string]spec.PathItem{
518-
"/apis/foo/v1": {},
520+
"/apis/foo/v1/": {},
519521
},
520522
},
521523
},
@@ -542,7 +544,7 @@ func TestFailingAPIServiceDoesNotBlockAdd(t *testing.T) {
542544
SwaggerProps: spec.SwaggerProps{
543545
Paths: &spec.Paths{
544546
Paths: map[string]spec.PathItem{
545-
"/apis/failed/v1": {},
547+
"/apis/failed/v1/": {},
546548
},
547549
},
548550
},
@@ -567,8 +569,8 @@ func TestFailingAPIServiceDoesNotBlockAdd(t *testing.T) {
567569
if err != nil {
568570
t.Error(err)
569571
}
570-
expectPath(t, swagger, "/apis/foo/v1")
571-
expectNoPath(t, swagger, "/apis/failed/v1")
572+
expectPath(t, swagger, "/apis/foo/v1/")
573+
expectNoPath(t, swagger, "/apis/failed/v1/")
572574
}
573575

574576
type openAPIHandler struct {
@@ -619,7 +621,7 @@ func buildAndRegisterSpecAggregator(delegationHandlers []http.Handler, mux commo
619621
SwaggerProps: spec.SwaggerProps{
620622
Paths: &spec.Paths{
621623
Paths: map[string]spec.PathItem{
622-
"/apis/apiregistration.k8s.io/v1": {},
624+
"/apis/apiregistration.k8s.io/v1/": {},
623625
},
624626
},
625627
},

0 commit comments

Comments
 (0)