mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Make deletes synchronous to avoid 202.
Also, get some POSTs I missed the last time.
This commit is contained in:
parent
5590adb2aa
commit
913cbd0fd1
@ -264,7 +264,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/pods/a" + syncFlags, aPod, code500}, // See #2114 about why 500
|
||||
{"GET", "/api/v1beta1/pods", "", code200},
|
||||
{"GET", "/api/v1beta1/pods/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/pods/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/pods/a" + syncFlags, "", code200},
|
||||
|
||||
// Non-standard methods (not expected to work,
|
||||
// but expected to pass/fail authorization prior to
|
||||
@ -284,7 +284,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/services/a" + syncFlags, aService, code422}, // TODO: GET and put back server-provided fields to avoid a 422
|
||||
{"GET", "/api/v1beta1/services", "", code200},
|
||||
{"GET", "/api/v1beta1/services/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/services/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/services/a" + syncFlags, "", code200},
|
||||
|
||||
// Normal methods on replicationControllers
|
||||
{"GET", "/api/v1beta1/replicationControllers", "", code200},
|
||||
@ -292,7 +292,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/replicationControllers/a" + syncFlags, aRC, code409}, // See #2115 about why 409
|
||||
{"GET", "/api/v1beta1/replicationControllers", "", code200},
|
||||
{"GET", "/api/v1beta1/replicationControllers/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/replicationControllers/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/replicationControllers/a" + syncFlags, "", code200},
|
||||
|
||||
// Normal methods on endpoints
|
||||
{"GET", "/api/v1beta1/endpoints", "", code200},
|
||||
@ -300,7 +300,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/endpoints/a" + syncFlags, aEndpoints, code200},
|
||||
{"GET", "/api/v1beta1/endpoints", "", code200},
|
||||
{"GET", "/api/v1beta1/endpoints/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/endpoints/a", "", code400},
|
||||
{"DELETE", "/api/v1beta1/endpoints/a" + syncFlags, "", code400},
|
||||
|
||||
// Normal methods on minions
|
||||
{"GET", "/api/v1beta1/minions", "", code200},
|
||||
@ -308,7 +308,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/minions/a" + syncFlags, aMinion, code500}, // See #2114 about why 500
|
||||
{"GET", "/api/v1beta1/minions", "", code200},
|
||||
{"GET", "/api/v1beta1/minions/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/minions/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/minions/a" + syncFlags, "", code200},
|
||||
|
||||
// Normal methods on events
|
||||
{"GET", "/api/v1beta1/events", "", code200},
|
||||
@ -317,7 +317,7 @@ func getTestRequests() []struct {
|
||||
{"GET", "/api/v1beta1/events", "", code200},
|
||||
{"GET", "/api/v1beta1/events", "", code200},
|
||||
{"GET", "/api/v1beta1/events/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/events/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/events/a" + syncFlags, "", code200},
|
||||
|
||||
// Normal methods on bindings
|
||||
{"GET", "/api/v1beta1/bindings", "", code404}, // Bindings are write-only, so 404
|
||||
@ -326,7 +326,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/bindings/a" + syncFlags, aBinding, code500}, // See #2114 about why 500
|
||||
{"GET", "/api/v1beta1/bindings", "", code404},
|
||||
{"GET", "/api/v1beta1/bindings/a", "", code404},
|
||||
{"DELETE", "/api/v1beta1/bindings/a", "", code404},
|
||||
{"DELETE", "/api/v1beta1/bindings/a" + syncFlags, "", code404},
|
||||
|
||||
// Non-existent object type.
|
||||
{"GET", "/api/v1beta1/foo", "", code404},
|
||||
@ -334,7 +334,7 @@ func getTestRequests() []struct {
|
||||
{"PUT", "/api/v1beta1/foo/a", `{"foo": "foo"}`, code404},
|
||||
{"GET", "/api/v1beta1/foo", "", code404},
|
||||
{"GET", "/api/v1beta1/foo/a", "", code404},
|
||||
{"DELETE", "/api/v1beta1/foo", "", code404},
|
||||
{"DELETE", "/api/v1beta1/foo" + syncFlags, "", code404},
|
||||
|
||||
// Operations
|
||||
{"GET", "/api/v1beta1/operations", "", code200},
|
||||
@ -680,20 +680,21 @@ func TestNamespaceAuthorization(t *testing.T) {
|
||||
body string
|
||||
statusCodes map[int]bool // allowed status codes.
|
||||
}{
|
||||
{"POST", "/api/v1beta1/pods?namespace=foo", aPod, code200},
|
||||
|
||||
{"POST", "/api/v1beta1/pods" + syncFlags + "&namespace=foo", aPod, code200},
|
||||
{"GET", "/api/v1beta1/pods?namespace=foo", "", code200},
|
||||
{"GET", "/api/v1beta1/pods/a?namespace=foo", "", code200},
|
||||
{"DELETE", "/api/v1beta1/pods/a?namespace=foo", "", code200},
|
||||
{"DELETE", "/api/v1beta1/pods/a" + syncFlags + "&namespace=foo", "", code200},
|
||||
|
||||
{"POST", "/api/v1beta1/pods?namespace=bar", aPod, code403},
|
||||
{"POST", "/api/v1beta1/pods" + syncFlags + "&namespace=bar", aPod, code403},
|
||||
{"GET", "/api/v1beta1/pods?namespace=bar", "", code403},
|
||||
{"GET", "/api/v1beta1/pods/a?namespace=bar", "", code403},
|
||||
{"DELETE", "/api/v1beta1/pods/a?namespace=bar", "", code403},
|
||||
{"DELETE", "/api/v1beta1/pods/a" + syncFlags + "&namespace=bar", "", code403},
|
||||
|
||||
{"POST", "/api/v1beta1/pods", aPod, code403},
|
||||
{"POST", "/api/v1beta1/pods" + syncFlags, aPod, code403},
|
||||
{"GET", "/api/v1beta1/pods", "", code403},
|
||||
{"GET", "/api/v1beta1/pods/a", "", code403},
|
||||
{"DELETE", "/api/v1beta1/pods/a", "", code403},
|
||||
{"DELETE", "/api/v1beta1/pods/a" + syncFlags, "", code403},
|
||||
}
|
||||
|
||||
for _, r := range requests {
|
||||
@ -756,15 +757,15 @@ func TestKindAuthorization(t *testing.T) {
|
||||
body string
|
||||
statusCodes map[int]bool // allowed status codes.
|
||||
}{
|
||||
{"POST", "/api/v1beta1/services", aService, code200},
|
||||
{"POST", "/api/v1beta1/services" + syncFlags, aService, code200},
|
||||
{"GET", "/api/v1beta1/services", "", code200},
|
||||
{"GET", "/api/v1beta1/services/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/services/a", "", code200},
|
||||
{"DELETE", "/api/v1beta1/services/a" + syncFlags, "", code200},
|
||||
|
||||
{"POST", "/api/v1beta1/pods", aPod, code403},
|
||||
{"POST", "/api/v1beta1/pods" + syncFlags, aPod, code403},
|
||||
{"GET", "/api/v1beta1/pods", "", code403},
|
||||
{"GET", "/api/v1beta1/pods/a", "", code403},
|
||||
{"DELETE", "/api/v1beta1/pods/a", "", code403},
|
||||
{"DELETE", "/api/v1beta1/pods/a" + syncFlags, "", code403},
|
||||
}
|
||||
|
||||
for _, r := range requests {
|
||||
|
Loading…
Reference in New Issue
Block a user