Updating kubectl to use POST instead of GET

This commit is contained in:
nikhiljindal
2015-07-01 16:47:02 -07:00
parent 09df440b79
commit b38d8b18a5
4 changed files with 22 additions and 48 deletions

View File

@@ -27,6 +27,7 @@ import (
"github.com/spf13/cobra"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/testapi"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
)
@@ -116,38 +117,24 @@ func TestPodAndContainer(t *testing.T) {
}
func TestExec(t *testing.T) {
version := testapi.Version()
tests := []struct {
name, version, podPath, execPath, container string
pod *api.Pod
execErr bool
}{
{
name: "v1beta3 - pod exec",
version: "v1beta3",
podPath: "/api/v1beta3/namespaces/test/pods/foo",
execPath: "/api/v1beta3/namespaces/test/pods/foo/exec",
name: "pod exec",
version: version,
podPath: "/api/" + version + "/namespaces/test/pods/foo",
execPath: "/api/" + version + "/namespaces/test/pods/foo/exec",
pod: execPod(),
},
{
name: "v1beta3 - pod exec error",
version: "v1beta3",
podPath: "/api/v1beta3/namespaces/test/pods/foo",
execPath: "/api/v1beta3/namespaces/test/pods/foo/exec",
pod: execPod(),
execErr: true,
},
{
name: "v1 - pod exec",
version: "v1",
podPath: "/api/v1/namespaces/test/pods/foo",
execPath: "/api/v1/namespaces/test/pods/foo/exec",
pod: execPod(),
},
{
name: "v1 - pod exec error",
version: "v1",
podPath: "/api/v1/namespaces/test/pods/foo",
execPath: "/api/v1/namespaces/test/pods/foo/exec",
name: "pod exec error",
version: version,
podPath: "/api/" + version + "/namespaces/test/pods/foo",
execPath: "/api/" + version + "/namespaces/test/pods/foo/exec",
pod: execPod(),
execErr: true,
},