mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
refactor testapi and test scripts to prepare for multiple API groups.
This commit is contained in:
@@ -49,7 +49,7 @@ func TestMerge(t *testing.T) {
|
||||
Name: "foo",
|
||||
},
|
||||
},
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s" }`, testapi.Version()),
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s" }`, testapi.Default.Version()),
|
||||
expected: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -82,7 +82,7 @@ func TestMerge(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "containers": [ { "name": "c1", "image": "green-image" } ] } }`, testapi.Version()),
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "containers": [ { "name": "c1", "image": "green-image" } ] } }`, testapi.Default.Version()),
|
||||
expected: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -108,7 +108,7 @@ func TestMerge(t *testing.T) {
|
||||
Name: "foo",
|
||||
},
|
||||
},
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "volumes": [ {"name": "v1"}, {"name": "v2"} ] } }`, testapi.Version()),
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "volumes": [ {"name": "v1"}, {"name": "v2"} ] } }`, testapi.Default.Version()),
|
||||
expected: &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -148,7 +148,7 @@ func TestMerge(t *testing.T) {
|
||||
obj: &api.Service{
|
||||
Spec: api.ServiceSpec{},
|
||||
},
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "ports": [ { "port": 0 } ] } }`, testapi.Version()),
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "ports": [ { "port": 0 } ] } }`, testapi.Default.Version()),
|
||||
expected: &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
SessionAffinity: "None",
|
||||
@@ -171,7 +171,7 @@ func TestMerge(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "selector": { "version": "v2" } } }`, testapi.Version()),
|
||||
fragment: fmt.Sprintf(`{ "apiVersion": "%s", "spec": { "selector": { "version": "v2" } } }`, testapi.Default.Version()),
|
||||
expected: &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
SessionAffinity: "None",
|
||||
|
||||
Reference in New Issue
Block a user