mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
testapi.Experimental -> testapi.Extensions
This commit is contained in:
parent
80f213c376
commit
f3caff2a79
@ -135,7 +135,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
|
|||||||
|
|
||||||
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
|
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
|
||||||
// We will fix this by supporting multiple group versions in Config
|
// We will fix this by supporting multiple group versions in Config
|
||||||
cl.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServer.URL, Version: testapi.Experimental.GroupAndVersion()})
|
cl.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServer.URL, Version: testapi.Extensions.GroupAndVersion()})
|
||||||
|
|
||||||
storageVersions := make(map[string]string)
|
storageVersions := make(map[string]string)
|
||||||
etcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("").InterfacesFor, testapi.Default.GroupAndVersion(), etcdtest.PathPrefix())
|
etcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("").InterfacesFor, testapi.Default.GroupAndVersion(), etcdtest.PathPrefix())
|
||||||
@ -143,8 +143,8 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Unable to get etcd storage: %v", err)
|
glog.Fatalf("Unable to get etcd storage: %v", err)
|
||||||
}
|
}
|
||||||
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("extensions").InterfacesFor, testapi.Experimental.GroupAndVersion(), etcdtest.PathPrefix())
|
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("extensions").InterfacesFor, testapi.Extensions.GroupAndVersion(), etcdtest.PathPrefix())
|
||||||
storageVersions["extensions"] = testapi.Experimental.GroupAndVersion()
|
storageVersions["extensions"] = testapi.Extensions.GroupAndVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("Unable to get etcd storage for experimental: %v", err)
|
glog.Fatalf("Unable to get etcd storage for experimental: %v", err)
|
||||||
}
|
}
|
||||||
@ -985,7 +985,7 @@ func main() {
|
|||||||
kubeClient := client.NewOrDie(&client.Config{Host: apiServerURL, Version: testapi.Default.GroupAndVersion()})
|
kubeClient := client.NewOrDie(&client.Config{Host: apiServerURL, Version: testapi.Default.GroupAndVersion()})
|
||||||
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
|
// TODO: caesarxuchao: hacky way to specify version of Experimental client.
|
||||||
// We will fix this by supporting multiple group versions in Config
|
// We will fix this by supporting multiple group versions in Config
|
||||||
kubeClient.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServerURL, Version: testapi.Experimental.GroupAndVersion()})
|
kubeClient.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServerURL, Version: testapi.Extensions.GroupAndVersion()})
|
||||||
|
|
||||||
// Run tests in parallel
|
// Run tests in parallel
|
||||||
testFuncs := []testFunc{
|
testFuncs := []testFunc{
|
||||||
|
@ -92,7 +92,7 @@ func (c *testClient) Setup(t *testing.T) *testClient {
|
|||||||
// We will fix this by supporting multiple group versions in Config
|
// We will fix this by supporting multiple group versions in Config
|
||||||
version = c.Version
|
version = c.Version
|
||||||
if len(version) == 0 {
|
if len(version) == 0 {
|
||||||
version = testapi.Experimental.Version()
|
version = testapi.Extensions.Version()
|
||||||
}
|
}
|
||||||
c.ExperimentalClient = NewExperimentalOrDie(&Config{
|
c.ExperimentalClient = NewExperimentalOrDie(&Config{
|
||||||
Host: c.server.URL,
|
Host: c.server.URL,
|
||||||
@ -229,8 +229,8 @@ func body(t *testing.T, obj runtime.Object, raw *string) *string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected encoding error: %v", err)
|
t.Errorf("unexpected encoding error: %v", err)
|
||||||
}
|
}
|
||||||
} else if api.Scheme.Recognizes(testapi.Experimental.GroupAndVersion(), kind) {
|
} else if api.Scheme.Recognizes(testapi.Extensions.GroupAndVersion(), kind) {
|
||||||
bs, err = testapi.Experimental.Codec().Encode(obj)
|
bs, err = testapi.Extensions.Codec().Encode(obj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected encoding error: %v", err)
|
t.Errorf("unexpected encoding error: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ func TestListDaemonSets(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, ""),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200,
|
Response: Response{StatusCode: 200,
|
||||||
Body: &experimental.DaemonSetList{
|
Body: &experimental.DaemonSetList{
|
||||||
@ -63,7 +63,7 @@ func TestListDaemonSets(t *testing.T) {
|
|||||||
func TestGetDaemonSet(t *testing.T) {
|
func TestGetDaemonSet(t *testing.T) {
|
||||||
ns := api.NamespaceDefault
|
ns := api.NamespaceDefault
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "GET", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "GET", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: &experimental.DaemonSet{
|
Body: &experimental.DaemonSet{
|
||||||
@ -101,7 +101,7 @@ func TestUpdateDaemonSet(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
|
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
|
||||||
}
|
}
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "PUT", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: &experimental.DaemonSet{
|
Body: &experimental.DaemonSet{
|
||||||
@ -128,7 +128,7 @@ func TestUpdateDaemonSetUpdateStatus(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
|
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
|
||||||
}
|
}
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo") + "/status", Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "PUT", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo") + "/status", Query: buildQueryValues(nil)},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: &experimental.DaemonSet{
|
Body: &experimental.DaemonSet{
|
||||||
@ -153,7 +153,7 @@ func TestUpdateDaemonSetUpdateStatus(t *testing.T) {
|
|||||||
func TestDeleteDaemon(t *testing.T) {
|
func TestDeleteDaemon(t *testing.T) {
|
||||||
ns := api.NamespaceDefault
|
ns := api.NamespaceDefault
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "DELETE", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "DELETE", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
}
|
}
|
||||||
err := c.Setup(t).Experimental().DaemonSets(ns).Delete("foo")
|
err := c.Setup(t).Experimental().DaemonSets(ns).Delete("foo")
|
||||||
@ -166,7 +166,7 @@ func TestCreateDaemonSet(t *testing.T) {
|
|||||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||||
}
|
}
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "POST", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, ""), Body: requestDaemonSet, Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "POST", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, ""), Body: requestDaemonSet, Query: buildQueryValues(nil)},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Body: &experimental.DaemonSet{
|
Body: &experimental.DaemonSet{
|
||||||
|
@ -42,7 +42,7 @@ func TestDeploymentCreate(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, ""),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
Body: &deployment,
|
Body: &deployment,
|
||||||
},
|
},
|
||||||
@ -67,7 +67,7 @@ func TestDeploymentGet(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, "abc"),
|
Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, "abc"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
Body: nil,
|
Body: nil,
|
||||||
},
|
},
|
||||||
@ -93,7 +93,7 @@ func TestDeploymentList(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, ""),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
Body: nil,
|
Body: nil,
|
||||||
},
|
},
|
||||||
@ -115,7 +115,7 @@ func TestDeploymentUpdate(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "PUT",
|
Method: "PUT",
|
||||||
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, "abc"),
|
Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, "abc"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200, Body: deployment},
|
Response: Response{StatusCode: 200, Body: deployment},
|
||||||
@ -129,7 +129,7 @@ func TestDeploymentDelete(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "DELETE",
|
Method: "DELETE",
|
||||||
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
@ -142,7 +142,7 @@ func TestDeploymentWatch(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePathWithPrefix("watch", getDeploymentsResoureName(), "", ""),
|
Path: testapi.Extensions.ResourcePathWithPrefix("watch", getDeploymentsResoureName(), "", ""),
|
||||||
Query: url.Values{"resourceVersion": []string{}},
|
Query: url.Values{"resourceVersion": []string{}},
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
|
@ -42,7 +42,7 @@ func TestHorizontalPodAutoscalerCreate(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
Body: &horizontalPodAutoscaler,
|
Body: &horizontalPodAutoscaler,
|
||||||
},
|
},
|
||||||
@ -67,7 +67,7 @@ func TestHorizontalPodAutoscalerGet(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"),
|
Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
Body: nil,
|
Body: nil,
|
||||||
},
|
},
|
||||||
@ -93,7 +93,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
Body: nil,
|
Body: nil,
|
||||||
},
|
},
|
||||||
@ -113,7 +113,7 @@ func TestHorizontalPodAutoscalerUpdate(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"), Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "PUT", Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"), Query: buildQueryValues(nil)},
|
||||||
Response: Response{StatusCode: 200, Body: horizontalPodAutoscaler},
|
Response: Response{StatusCode: 200, Body: horizontalPodAutoscaler},
|
||||||
}
|
}
|
||||||
response, err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Update(horizontalPodAutoscaler)
|
response, err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Update(horizontalPodAutoscaler)
|
||||||
@ -123,7 +123,7 @@ func TestHorizontalPodAutoscalerUpdate(t *testing.T) {
|
|||||||
func TestHorizontalPodAutoscalerDelete(t *testing.T) {
|
func TestHorizontalPodAutoscalerDelete(t *testing.T) {
|
||||||
ns := api.NamespaceDefault
|
ns := api.NamespaceDefault
|
||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{Method: "DELETE", Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "foo"), Query: buildQueryValues(nil)},
|
Request: testRequest{Method: "DELETE", Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "foo"), Query: buildQueryValues(nil)},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
}
|
}
|
||||||
err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Delete("foo", nil)
|
err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Delete("foo", nil)
|
||||||
@ -134,7 +134,7 @@ func TestHorizontalPodAutoscalerWatch(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePathWithPrefix("watch", getHorizontalPodAutoscalersResoureName(), "", ""),
|
Path: testapi.Extensions.ResourcePathWithPrefix("watch", getHorizontalPodAutoscalersResoureName(), "", ""),
|
||||||
Query: url.Values{"resourceVersion": []string{}}},
|
Query: url.Values{"resourceVersion": []string{}}},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ func TestListIngress(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, ""),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200,
|
Response: Response{StatusCode: 200,
|
||||||
Body: &experimental.IngressList{
|
Body: &experimental.IngressList{
|
||||||
@ -65,7 +65,7 @@ func TestGetIngress(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
@ -111,7 +111,7 @@ func TestUpdateIngress(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "PUT",
|
Method: "PUT",
|
||||||
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
@ -154,7 +154,7 @@ func TestUpdateIngressStatus(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "PUT",
|
Method: "PUT",
|
||||||
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo") + "/status",
|
Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo") + "/status",
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
@ -185,7 +185,7 @@ func TestDeleteIngress(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "DELETE",
|
Method: "DELETE",
|
||||||
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
@ -205,7 +205,7 @@ func TestCreateIngress(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, ""),
|
||||||
Body: requestIngress,
|
Body: requestIngress,
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
|
@ -35,7 +35,7 @@ func TestListJobs(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, ""),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200,
|
Response: Response{StatusCode: 200,
|
||||||
Body: &experimental.JobList{
|
Body: &experimental.JobList{
|
||||||
@ -65,7 +65,7 @@ func TestGetJob(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
@ -111,7 +111,7 @@ func TestUpdateJob(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "PUT",
|
Method: "PUT",
|
||||||
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
@ -146,7 +146,7 @@ func TestUpdateJobStatus(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "PUT",
|
Method: "PUT",
|
||||||
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo") + "/status",
|
Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo") + "/status",
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{
|
Response: Response{
|
||||||
@ -177,7 +177,7 @@ func TestDeleteJob(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "DELETE",
|
Method: "DELETE",
|
||||||
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo"),
|
Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo"),
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
Response: Response{StatusCode: 200},
|
Response: Response{StatusCode: 200},
|
||||||
@ -197,7 +197,7 @@ func TestCreateJob(t *testing.T) {
|
|||||||
c := &testClient{
|
c := &testClient{
|
||||||
Request: testRequest{
|
Request: testRequest{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, ""),
|
Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, ""),
|
||||||
Body: requestJob,
|
Body: requestJob,
|
||||||
Query: buildQueryValues(nil),
|
Query: buildQueryValues(nil),
|
||||||
},
|
},
|
||||||
|
@ -53,7 +53,7 @@ func getKey(ds *experimental.DaemonSet, t *testing.T) string {
|
|||||||
|
|
||||||
func newDaemonSet(name string) *experimental.DaemonSet {
|
func newDaemonSet(name string) *experimental.DaemonSet {
|
||||||
return &experimental.DaemonSet{
|
return &experimental.DaemonSet{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Experimental.Version()},
|
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Extensions.Version()},
|
||||||
ObjectMeta: api.ObjectMeta{
|
ObjectMeta: api.ObjectMeta{
|
||||||
Name: name,
|
Name: name,
|
||||||
Namespace: api.NamespaceDefault,
|
Namespace: api.NamespaceDefault,
|
||||||
|
@ -64,9 +64,9 @@ func TestV1EncodeDecodeStatus(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestExperimentalEncodeDecodeStatus(t *testing.T) {
|
func TestExperimentalEncodeDecodeStatus(t *testing.T) {
|
||||||
// TODO: caesarxuchao: use the testapi.Experimental.Codec() once the PR that
|
// TODO: caesarxuchao: use the testapi.Extensions.Codec() once the PR that
|
||||||
// moves experimental from v1 to v1beta1 got merged.
|
// moves experimental from v1 to v1beta1 got merged.
|
||||||
// expCodec := testapi.Experimental.Codec()
|
// expCodec := testapi.Extensions.Codec()
|
||||||
expCodec := runtime.CodecFor(api.Scheme, "extensions/v1beta1")
|
expCodec := runtime.CodecFor(api.Scheme, "extensions/v1beta1")
|
||||||
encoded, err := expCodec.Encode(status)
|
encoded, err := expCodec.Encode(status)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -67,10 +67,10 @@ func setUp(t *testing.T) (Master, Config, *assert.Assertions) {
|
|||||||
storageVersions := make(map[string]string)
|
storageVersions := make(map[string]string)
|
||||||
storageDestinations := NewStorageDestinations()
|
storageDestinations := NewStorageDestinations()
|
||||||
storageDestinations.AddAPIGroup("", etcdstorage.NewEtcdStorage(fakeClient, testapi.Default.Codec(), etcdtest.PathPrefix()))
|
storageDestinations.AddAPIGroup("", etcdstorage.NewEtcdStorage(fakeClient, testapi.Default.Codec(), etcdtest.PathPrefix()))
|
||||||
storageDestinations.AddAPIGroup("extensions", etcdstorage.NewEtcdStorage(fakeClient, testapi.Experimental.Codec(), etcdtest.PathPrefix()))
|
storageDestinations.AddAPIGroup("extensions", etcdstorage.NewEtcdStorage(fakeClient, testapi.Extensions.Codec(), etcdtest.PathPrefix()))
|
||||||
config.StorageDestinations = storageDestinations
|
config.StorageDestinations = storageDestinations
|
||||||
storageVersions[""] = testapi.Default.Version()
|
storageVersions[""] = testapi.Default.Version()
|
||||||
storageVersions["extensions"] = testapi.Experimental.GroupAndVersion()
|
storageVersions["extensions"] = testapi.Extensions.GroupAndVersion()
|
||||||
config.StorageVersions = storageVersions
|
config.StorageVersions = storageVersions
|
||||||
master.nodeRegistry = registrytest.NewNodeRegistry([]string{"node1", "node2"}, api.NodeResources{})
|
master.nodeRegistry = registrytest.NewNodeRegistry([]string{"node1", "node2"}, api.NodeResources{})
|
||||||
|
|
||||||
@ -474,8 +474,8 @@ func TestDiscoveryAtAPIS(t *testing.T) {
|
|||||||
expectGroupName := "extensions"
|
expectGroupName := "extensions"
|
||||||
expectVersions := []api.GroupVersion{
|
expectVersions := []api.GroupVersion{
|
||||||
{
|
{
|
||||||
GroupVersion: testapi.Experimental.GroupAndVersion(),
|
GroupVersion: testapi.Extensions.GroupAndVersion(),
|
||||||
Version: testapi.Experimental.Version(),
|
Version: testapi.Extensions.Version(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
expectPreferredVersion := api.GroupVersion{
|
expectPreferredVersion := api.GroupVersion{
|
||||||
@ -522,7 +522,7 @@ func initThirdParty(t *testing.T, version string) (*Master, *tools.FakeEtcdClien
|
|||||||
|
|
||||||
fakeClient := tools.NewFakeEtcdClient(t)
|
fakeClient := tools.NewFakeEtcdClient(t)
|
||||||
fakeClient.Machines = []string{"http://machine1:4001", "http://machine2", "http://machine3:4003"}
|
fakeClient.Machines = []string{"http://machine1:4001", "http://machine2", "http://machine3:4003"}
|
||||||
master.thirdPartyStorage = etcdstorage.NewEtcdStorage(fakeClient, testapi.Experimental.Codec(), etcdtest.PathPrefix())
|
master.thirdPartyStorage = etcdstorage.NewEtcdStorage(fakeClient, testapi.Extensions.Codec(), etcdtest.PathPrefix())
|
||||||
|
|
||||||
if !assert.NoError(master.InstallThirdPartyResource(api)) {
|
if !assert.NoError(master.InstallThirdPartyResource(api)) {
|
||||||
t.FailNow()
|
t.FailNow()
|
||||||
@ -634,7 +634,7 @@ func encodeToThirdParty(name string, obj interface{}) ([]byte, error) {
|
|||||||
ObjectMeta: api.ObjectMeta{Name: name},
|
ObjectMeta: api.ObjectMeta{Name: name},
|
||||||
Data: serial,
|
Data: serial,
|
||||||
}
|
}
|
||||||
return testapi.Experimental.Codec().Encode(&thirdPartyData)
|
return testapi.Extensions.Codec().Encode(&thirdPartyData)
|
||||||
}
|
}
|
||||||
|
|
||||||
func storeToEtcd(fakeClient *tools.FakeEtcdClient, path, name string, obj interface{}) error {
|
func storeToEtcd(fakeClient *tools.FakeEtcdClient, path, name string, obj interface{}) error {
|
||||||
@ -774,7 +774,7 @@ func testInstallThirdPartyAPIPostForVersion(t *testing.T, version string) {
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
obj, err := testapi.Experimental.Codec().Decode([]byte(etcdResp.Node.Value))
|
obj, err := testapi.Extensions.Codec().Decode([]byte(etcdResp.Node.Value))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ func TestScaleGet(t *testing.T) {
|
|||||||
|
|
||||||
ctx := api.WithNamespace(api.NewContext(), namespace)
|
ctx := api.WithNamespace(api.NewContext(), namespace)
|
||||||
key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name)
|
key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name)
|
||||||
if _, err := fakeClient.Set(key, runtime.EncodeOrDie(testapi.Experimental.Codec(), &validDeployment), 0); err != nil {
|
if _, err := fakeClient.Set(key, runtime.EncodeOrDie(testapi.Extensions.Codec(), &validDeployment), 0); err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ func TestScaleUpdate(t *testing.T) {
|
|||||||
|
|
||||||
ctx := api.WithNamespace(api.NewContext(), namespace)
|
ctx := api.WithNamespace(api.NewContext(), namespace)
|
||||||
key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name)
|
key := etcdtest.AddPrefix("/deployments/" + namespace + "/" + name)
|
||||||
if _, err := fakeClient.Set(key, runtime.EncodeOrDie(testapi.Experimental.Codec(), &validDeployment), 0); err != nil {
|
if _, err := fakeClient.Set(key, runtime.EncodeOrDie(testapi.Extensions.Codec(), &validDeployment), 0); err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
replicas := 12
|
replicas := 12
|
||||||
@ -231,7 +231,7 @@ func TestScaleUpdate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var deployment experimental.Deployment
|
var deployment experimental.Deployment
|
||||||
testapi.Experimental.Codec().DecodeInto([]byte(response.Node.Value), &deployment)
|
testapi.Extensions.Codec().DecodeInto([]byte(response.Node.Value), &deployment)
|
||||||
if deployment.Spec.Replicas != replicas {
|
if deployment.Spec.Replicas != replicas {
|
||||||
t.Errorf("wrong replicas count expected: %d got: %d", replicas, deployment.Spec.Replicas)
|
t.Errorf("wrong replicas count expected: %d got: %d", replicas, deployment.Spec.Replicas)
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ func TestUpdate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var controller api.ReplicationController
|
var controller api.ReplicationController
|
||||||
testapi.Experimental.Codec().DecodeInto([]byte(response.Node.Value), &controller)
|
testapi.Extensions.Codec().DecodeInto([]byte(response.Node.Value), &controller)
|
||||||
if controller.Spec.Replicas != replicas {
|
if controller.Spec.Replicas != replicas {
|
||||||
t.Errorf("wrong replicas count expected: %d got: %d", replicas, controller.Spec.Replicas)
|
t.Errorf("wrong replicas count expected: %d got: %d", replicas, controller.Spec.Replicas)
|
||||||
}
|
}
|
||||||
|
@ -163,8 +163,8 @@ func getCodec(obj runtime.Object) (runtime.Codec, error) {
|
|||||||
var codec runtime.Codec
|
var codec runtime.Codec
|
||||||
if api.Scheme.Recognizes(testapi.Default.GroupAndVersion(), kind) {
|
if api.Scheme.Recognizes(testapi.Default.GroupAndVersion(), kind) {
|
||||||
codec = testapi.Default.Codec()
|
codec = testapi.Default.Codec()
|
||||||
} else if api.Scheme.Recognizes(testapi.Experimental.GroupAndVersion(), kind) {
|
} else if api.Scheme.Recognizes(testapi.Extensions.GroupAndVersion(), kind) {
|
||||||
codec = testapi.Experimental.Codec()
|
codec = testapi.Extensions.Codec()
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("unexpected kind: %v", kind)
|
return nil, fmt.Errorf("unexpected kind: %v", kind)
|
||||||
}
|
}
|
||||||
|
@ -275,8 +275,8 @@ func RunAMaster(t *testing.T) (*master.Master, *httptest.Server) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("extensions").InterfacesFor, testapi.Experimental.GroupAndVersion(), etcdtest.PathPrefix())
|
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("extensions").InterfacesFor, testapi.Extensions.GroupAndVersion(), etcdtest.PathPrefix())
|
||||||
storageVersions["extensions"] = testapi.Experimental.GroupAndVersion()
|
storageVersions["extensions"] = testapi.Extensions.GroupAndVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user