mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
This commit is contained in:
@@ -53,14 +53,14 @@ func init() {
|
||||
}
|
||||
|
||||
type Simple struct {
|
||||
api.JSONBase `yaml:",inline" json:",inline"`
|
||||
api.TypeMeta `yaml:",inline" json:",inline"`
|
||||
Name string `yaml:"name,omitempty" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (*Simple) IsAnAPIObject() {}
|
||||
|
||||
type SimpleList struct {
|
||||
api.JSONBase `yaml:",inline" json:",inline"`
|
||||
api.TypeMeta `yaml:",inline" json:",inline"`
|
||||
Items []Simple `yaml:"items,omitempty" json:"items,omitempty"`
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ func (storage *SimpleRESTStorage) Delete(ctx api.Context, id string) (<-chan run
|
||||
}
|
||||
return MakeAsync(func() (runtime.Object, error) {
|
||||
if storage.injectedFunction != nil {
|
||||
return storage.injectedFunction(&Simple{JSONBase: api.JSONBase{ID: id}})
|
||||
return storage.injectedFunction(&Simple{TypeMeta: api.TypeMeta{ID: id}})
|
||||
}
|
||||
return &api.Status{Status: api.StatusSuccess}, nil
|
||||
}), nil
|
||||
@@ -288,7 +288,7 @@ func TestNonEmptyList(t *testing.T) {
|
||||
simpleStorage := SimpleRESTStorage{
|
||||
list: []Simple{
|
||||
{
|
||||
JSONBase: api.JSONBase{Kind: "Simple"},
|
||||
TypeMeta: api.TypeMeta{Kind: "Simple"},
|
||||
Name: "foo",
|
||||
},
|
||||
},
|
||||
|
@@ -125,7 +125,7 @@ func (ops *Operations) List() *api.ServerOpList {
|
||||
sort.StringSlice(ids).Sort()
|
||||
ol := &api.ServerOpList{}
|
||||
for _, id := range ids {
|
||||
ol.Items = append(ol.Items, api.ServerOp{JSONBase: api.JSONBase{ID: id}})
|
||||
ol.Items = append(ol.Items, api.ServerOp{TypeMeta: api.TypeMeta{ID: id}})
|
||||
}
|
||||
return ol
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ func TestOperation(t *testing.T) {
|
||||
time.Sleep(time.Millisecond)
|
||||
go func() {
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
c <- &Simple{JSONBase: api.JSONBase{ID: "All done"}}
|
||||
c <- &Simple{TypeMeta: api.TypeMeta{ID: "All done"}}
|
||||
}()
|
||||
|
||||
if op.expired(time.Now().Add(-time.Minute)) {
|
||||
|
Reference in New Issue
Block a user