Merge pull request #63238 from CaoShuFeng/toCurl

Automatic merge from submit-queue (batch tested with PRs 63153, 63238). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix curl header

partially reverts kubernetes/kubernetes#60925

such command cause a 406 status code from api-server
```
curl   -H "Accept: 'application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json'"
```

this works fine:
```
curl  -H "Accept: application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json"
```

**Release note**:
```
NONE
```

Kubernetes-commit: a8a963c98396ef8b5cd08911d0d4d7edbfff78fd
This commit is contained in:
Kubernetes Publisher 2018-04-27 13:23:05 -07:00
commit e26238c324
2 changed files with 55 additions and 55 deletions

108
Godeps/Godeps.json generated
View File

@ -1,6 +1,6 @@
{ {
"ImportPath": "k8s.io/client-go", "ImportPath": "k8s.io/client-go",
"GoVersion": "go1.10", "GoVersion": "go1.9",
"GodepVersion": "v80", "GodepVersion": "v80",
"Packages": [ "Packages": [
"./..." "./..."
@ -368,215 +368,215 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing", "ImportPath": "k8s.io/apimachinery/pkg/api/testing",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "c416ded332245f3aa810919a74cc5b561142696c" "Rev": "2ad92c37230c7d04408c333e1d1db20450abdc7e"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "ImportPath": "k8s.io/kube-openapi/pkg/util/proto",

View File

@ -331,7 +331,7 @@ func (r *requestInfo) toCurl() string {
headers := "" headers := ""
for key, values := range r.RequestHeaders { for key, values := range r.RequestHeaders {
for _, value := range values { for _, value := range values {
headers += fmt.Sprintf(` -H %q`, fmt.Sprintf("%s: '%s'", key, value)) headers += fmt.Sprintf(` -H %q`, fmt.Sprintf("%s: %s", key, value))
} }
} }