mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
change v1beta3 to v1 in test cases
This commit is contained in:
parent
2ee8eb67a9
commit
6b81c064ed
@ -28,14 +28,14 @@ import (
|
|||||||
func TestScopeNamingGenerateLink(t *testing.T) {
|
func TestScopeNamingGenerateLink(t *testing.T) {
|
||||||
selfLinker := &setTestSelfLinker{
|
selfLinker := &setTestSelfLinker{
|
||||||
t: t,
|
t: t,
|
||||||
expectedSet: "/api/v1beta3/namespaces/other/services/foo",
|
expectedSet: "/api/v1/namespaces/other/services/foo",
|
||||||
name: "foo",
|
name: "foo",
|
||||||
namespace: "other",
|
namespace: "other",
|
||||||
}
|
}
|
||||||
s := scopeNaming{
|
s := scopeNaming{
|
||||||
meta.RESTScopeNamespace,
|
meta.RESTScopeNamespace,
|
||||||
selfLinker,
|
selfLinker,
|
||||||
"/api/v1beta3/namespaces/{namespace}/services/{name}",
|
"/api/v1/namespaces/{namespace}/services/{name}",
|
||||||
true,
|
true,
|
||||||
}
|
}
|
||||||
service := &api.Service{
|
service := &api.Service{
|
||||||
|
@ -67,7 +67,7 @@ func TestAddOrUpdateEventExisting(t *testing.T) {
|
|||||||
Name: "anOkName",
|
Name: "anOkName",
|
||||||
Namespace: "someNamespace",
|
Namespace: "someNamespace",
|
||||||
UID: "C934D3234CD0242",
|
UID: "C934D3234CD0242",
|
||||||
APIVersion: "v1beta2",
|
APIVersion: "version",
|
||||||
},
|
},
|
||||||
Source: api.EventSource{
|
Source: api.EventSource{
|
||||||
Component: "kubelet",
|
Component: "kubelet",
|
||||||
@ -88,7 +88,7 @@ func TestAddOrUpdateEventExisting(t *testing.T) {
|
|||||||
Name: "anOkName",
|
Name: "anOkName",
|
||||||
Namespace: "someNamespace",
|
Namespace: "someNamespace",
|
||||||
UID: "C934D3234CD0242",
|
UID: "C934D3234CD0242",
|
||||||
APIVersion: "v1beta2",
|
APIVersion: "version",
|
||||||
},
|
},
|
||||||
Source: api.EventSource{
|
Source: api.EventSource{
|
||||||
Component: "kubelet",
|
Component: "kubelet",
|
||||||
@ -119,7 +119,7 @@ func TestGetEventNoExisting(t *testing.T) {
|
|||||||
Name: "iAmAController",
|
Name: "iAmAController",
|
||||||
Namespace: "IHaveANamespace",
|
Namespace: "IHaveANamespace",
|
||||||
UID: "9039D34AFBCDA42",
|
UID: "9039D34AFBCDA42",
|
||||||
APIVersion: "v1beta3",
|
APIVersion: "version",
|
||||||
},
|
},
|
||||||
Source: api.EventSource{
|
Source: api.EventSource{
|
||||||
Component: "kubelet",
|
Component: "kubelet",
|
||||||
|
@ -49,7 +49,7 @@ func TestRunExposeService(t *testing.T) {
|
|||||||
},
|
},
|
||||||
input: &api.Service{
|
input: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "baz", Namespace: "test", ResourceVersion: "12"},
|
ObjectMeta: api.ObjectMeta{Name: "baz", Namespace: "test", ResourceVersion: "12"},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
Spec: api.ServiceSpec{
|
Spec: api.ServiceSpec{
|
||||||
Selector: map[string]string{"app": "go"},
|
Selector: map[string]string{"app": "go"},
|
||||||
},
|
},
|
||||||
@ -57,7 +57,7 @@ func TestRunExposeService(t *testing.T) {
|
|||||||
flags: map[string]string{"selector": "func=stream", "protocol": "UDP", "port": "14", "name": "foo", "labels": "svc=test"},
|
flags: map[string]string{"selector": "func=stream", "protocol": "UDP", "port": "14", "name": "foo", "labels": "svc=test"},
|
||||||
output: &api.Service{
|
output: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "test", ResourceVersion: "12", Labels: map[string]string{"svc": "test"}},
|
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "test", ResourceVersion: "12", Labels: map[string]string{"svc": "test"}},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
Spec: api.ServiceSpec{
|
Spec: api.ServiceSpec{
|
||||||
Ports: []api.ServicePort{
|
Ports: []api.ServicePort{
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ func TestRunExposeService(t *testing.T) {
|
|||||||
},
|
},
|
||||||
input: &api.Service{
|
input: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "mayor", Namespace: "default", ResourceVersion: "12"},
|
ObjectMeta: api.ObjectMeta{Name: "mayor", Namespace: "default", ResourceVersion: "12"},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
Spec: api.ServiceSpec{
|
Spec: api.ServiceSpec{
|
||||||
Selector: map[string]string{"run": "this"},
|
Selector: map[string]string{"run": "this"},
|
||||||
},
|
},
|
||||||
@ -91,7 +91,7 @@ func TestRunExposeService(t *testing.T) {
|
|||||||
flags: map[string]string{"selector": "run=this", "port": "80", "labels": "runas=amayor"},
|
flags: map[string]string{"selector": "run=this", "port": "80", "labels": "runas=amayor"},
|
||||||
output: &api.Service{
|
output: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "mayor", Namespace: "default", ResourceVersion: "12", Labels: map[string]string{"runas": "amayor"}},
|
ObjectMeta: api.ObjectMeta{Name: "mayor", Namespace: "default", ResourceVersion: "12", Labels: map[string]string{"runas": "amayor"}},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
Spec: api.ServiceSpec{
|
Spec: api.ServiceSpec{
|
||||||
Ports: []api.ServicePort{
|
Ports: []api.ServicePort{
|
||||||
{
|
{
|
||||||
|
@ -117,7 +117,7 @@ func TestLabelsForObject(t *testing.T) {
|
|||||||
name: "successful re-use of labels",
|
name: "successful re-use of labels",
|
||||||
object: &api.Service{
|
object: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "baz", Namespace: "test", Labels: map[string]string{"svc": "test"}},
|
ObjectMeta: api.ObjectMeta{Name: "baz", Namespace: "test", Labels: map[string]string{"svc": "test"}},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
},
|
},
|
||||||
expected: "svc=test",
|
expected: "svc=test",
|
||||||
err: nil,
|
err: nil,
|
||||||
@ -126,7 +126,7 @@ func TestLabelsForObject(t *testing.T) {
|
|||||||
name: "empty labels",
|
name: "empty labels",
|
||||||
object: &api.Service{
|
object: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "test", Labels: map[string]string{}},
|
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "test", Labels: map[string]string{}},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
},
|
},
|
||||||
expected: "",
|
expected: "",
|
||||||
err: nil,
|
err: nil,
|
||||||
@ -135,7 +135,7 @@ func TestLabelsForObject(t *testing.T) {
|
|||||||
name: "nil labels",
|
name: "nil labels",
|
||||||
object: &api.Service{
|
object: &api.Service{
|
||||||
ObjectMeta: api.ObjectMeta{Name: "zen", Namespace: "test", Labels: nil},
|
ObjectMeta: api.ObjectMeta{Name: "zen", Namespace: "test", Labels: nil},
|
||||||
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1beta3"},
|
TypeMeta: api.TypeMeta{Kind: "Service", APIVersion: "v1"},
|
||||||
},
|
},
|
||||||
expected: "",
|
expected: "",
|
||||||
err: nil,
|
err: nil,
|
||||||
|
Loading…
Reference in New Issue
Block a user