mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 05:02:50 +00:00
Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
This commit is contained in:
@@ -77,7 +77,7 @@ func (e *EndpointController) SyncServiceEndpoints() error {
|
||||
// TODO this is brittle as all get out, refactor the client libraries to return a structured error.
|
||||
if errors.IsNotFound(err) {
|
||||
currentEndpoints = &api.Endpoints{
|
||||
JSONBase: api.JSONBase{
|
||||
TypeMeta: api.TypeMeta{
|
||||
ID: service.ID,
|
||||
},
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ func newPodList(count int) api.PodList {
|
||||
pods := []api.Pod{}
|
||||
for i := 0; i < count; i++ {
|
||||
pods = append(pods, api.Pod{
|
||||
JSONBase: api.JSONBase{
|
||||
TypeMeta: api.TypeMeta{
|
||||
ID: fmt.Sprintf("pod%d", i),
|
||||
APIVersion: testapi.Version(),
|
||||
},
|
||||
@@ -57,7 +57,7 @@ func newPodList(count int) api.PodList {
|
||||
})
|
||||
}
|
||||
return api.PodList{
|
||||
JSONBase: api.JSONBase{APIVersion: testapi.Version(), Kind: "PodList"},
|
||||
TypeMeta: api.TypeMeta{APIVersion: testapi.Version(), Kind: "PodList"},
|
||||
Items: pods,
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ func TestSyncEndpointsItemsPreexisting(t *testing.T) {
|
||||
serviceList := api.ServiceList{
|
||||
Items: []api.Service{
|
||||
{
|
||||
JSONBase: api.JSONBase{ID: "foo"},
|
||||
TypeMeta: api.TypeMeta{ID: "foo"},
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
@@ -192,7 +192,7 @@ func TestSyncEndpointsItemsPreexisting(t *testing.T) {
|
||||
serverResponse{http.StatusOK, newPodList(1)},
|
||||
serverResponse{http.StatusOK, serviceList},
|
||||
serverResponse{http.StatusOK, api.Endpoints{
|
||||
JSONBase: api.JSONBase{
|
||||
TypeMeta: api.TypeMeta{
|
||||
ID: "foo",
|
||||
ResourceVersion: 1,
|
||||
},
|
||||
@@ -204,7 +204,7 @@ func TestSyncEndpointsItemsPreexisting(t *testing.T) {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
data := runtime.EncodeOrDie(testapi.CodecForVersionOrDie(), &api.Endpoints{
|
||||
JSONBase: api.JSONBase{
|
||||
TypeMeta: api.TypeMeta{
|
||||
ID: "foo",
|
||||
ResourceVersion: 1,
|
||||
},
|
||||
@@ -217,7 +217,7 @@ func TestSyncEndpointsItemsPreexistingIdentical(t *testing.T) {
|
||||
serviceList := api.ServiceList{
|
||||
Items: []api.Service{
|
||||
{
|
||||
JSONBase: api.JSONBase{ID: "foo"},
|
||||
TypeMeta: api.TypeMeta{ID: "foo"},
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
@@ -228,7 +228,7 @@ func TestSyncEndpointsItemsPreexistingIdentical(t *testing.T) {
|
||||
serverResponse{http.StatusOK, newPodList(1)},
|
||||
serverResponse{http.StatusOK, serviceList},
|
||||
serverResponse{http.StatusOK, api.Endpoints{
|
||||
JSONBase: api.JSONBase{
|
||||
TypeMeta: api.TypeMeta{
|
||||
ResourceVersion: 1,
|
||||
},
|
||||
Endpoints: []string{"1.2.3.4:8080"},
|
||||
@@ -245,7 +245,7 @@ func TestSyncEndpointsItems(t *testing.T) {
|
||||
serviceList := api.ServiceList{
|
||||
Items: []api.Service{
|
||||
{
|
||||
JSONBase: api.JSONBase{ID: "foo"},
|
||||
TypeMeta: api.TypeMeta{ID: "foo"},
|
||||
Selector: map[string]string{
|
||||
"foo": "bar",
|
||||
},
|
||||
@@ -262,7 +262,7 @@ func TestSyncEndpointsItems(t *testing.T) {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
data := runtime.EncodeOrDie(testapi.CodecForVersionOrDie(), &api.Endpoints{
|
||||
JSONBase: api.JSONBase{
|
||||
TypeMeta: api.TypeMeta{
|
||||
ResourceVersion: 0,
|
||||
},
|
||||
Endpoints: []string{"1.2.3.4:8080"},
|
||||
|
Reference in New Issue
Block a user