Delete deprecated API versions

pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
This commit is contained in:
Kris
2015-05-22 08:20:27 -07:00
parent f3b4b1aa31
commit f4e2c738f6
55 changed files with 3449 additions and 37462 deletions

View File

@@ -43,7 +43,7 @@ func TestMerge(t *testing.T) {
Name: "foo",
},
},
fragment: `{ "apiVersion": "v1beta1" }`,
fragment: `{ "apiVersion": "v1beta3" }`,
expected: &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "foo",
@@ -94,25 +94,6 @@ func TestMerge(t *testing.T) {
},
},
}, */
{
kind: "Pod",
obj: &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "foo",
},
},
fragment: `{ "apiVersion": "v1beta1", "id": "baz", "desiredState": { "host": "bar" } }`,
expected: &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "baz",
},
Spec: api.PodSpec{
NodeName: "bar",
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
},
},
},
{
kind: "Pod",
obj: &api.Pod{
@@ -148,24 +129,6 @@ func TestMerge(t *testing.T) {
expected: &api.Pod{},
expectErr: true,
},
{
kind: "Pod",
obj: &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "foo",
},
},
fragment: `{ "apiVersion": "v1beta1", "id": null}`,
expected: &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "",
},
Spec: api.PodSpec{
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
},
},
},
{
kind: "Service",
obj: &api.Service{},
@@ -177,11 +140,17 @@ func TestMerge(t *testing.T) {
obj: &api.Service{
Spec: api.ServiceSpec{},
},
fragment: `{ "apiVersion": "v1beta1", "port": 0 }`,
fragment: `{ "apiVersion": "v1beta3", "spec": { "ports": [ { "port": 0 } ] } }`,
expected: &api.Service{
Spec: api.ServiceSpec{
SessionAffinity: "None",
Type: api.ServiceTypeClusterIP,
Ports: []api.ServicePort{
{
Protocol: api.ProtocolTCP,
Port: 0,
},
},
},
},
},
@@ -194,7 +163,7 @@ func TestMerge(t *testing.T) {
},
},
},
fragment: `{ "apiVersion": "v1beta1", "selector": { "version": "v2" } }`,
fragment: `{ "apiVersion": "v1beta3", "spec": { "selector": { "version": "v2" } } }`,
expected: &api.Service{
Spec: api.ServiceSpec{
SessionAffinity: "None",