experimental. -> extensions.

This commit is contained in:
Chao Xu
2015-10-09 15:49:10 -07:00
parent 2816eb0f8a
commit 7c9f4cc42f
81 changed files with 839 additions and 839 deletions

View File

@@ -38,8 +38,8 @@ func NewREST(s storage.Interface) *REST {
prefix := "/thirdpartyresources"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &experimental.ThirdPartyResource{} },
NewListFunc: func() runtime.Object { return &experimental.ThirdPartyResourceList{} },
NewFunc: func() runtime.Object { return &extensions.ThirdPartyResource{} },
NewListFunc: func() runtime.Object { return &extensions.ThirdPartyResourceList{} },
KeyRootFunc: func(ctx api.Context) string {
return etcdgeneric.NamespaceKeyRootFunc(ctx, prefix)
},
@@ -47,7 +47,7 @@ func NewREST(s storage.Interface) *REST {
return etcdgeneric.NamespaceKeyFunc(ctx, prefix, id)
},
ObjectNameFunc: func(obj runtime.Object) (string, error) {
return obj.(*experimental.ThirdPartyResource).Name, nil
return obj.(*extensions.ThirdPartyResource).Name, nil
},
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
return thirdpartyresource.Matcher(label, field)

View File

@@ -35,13 +35,13 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
return NewREST(etcdStorage), fakeClient
}
func validNewThirdPartyResource(name string) *experimental.ThirdPartyResource {
return &experimental.ThirdPartyResource{
func validNewThirdPartyResource(name string) *extensions.ThirdPartyResource {
return &extensions.ThirdPartyResource{
ObjectMeta: api.ObjectMeta{
Name: name,
Namespace: api.NamespaceDefault,
},
Versions: []experimental.APIVersion{
Versions: []extensions.APIVersion{
{
Name: "stable/v1",
},
@@ -58,7 +58,7 @@ func TestCreate(t *testing.T) {
// valid
rsrc,
// invalid
&experimental.ThirdPartyResource{},
&extensions.ThirdPartyResource{},
)
}
@@ -70,7 +70,7 @@ func TestUpdate(t *testing.T) {
validNewThirdPartyResource("foo"),
// updateFunc
func(obj runtime.Object) runtime.Object {
object := obj.(*experimental.ThirdPartyResource)
object := obj.(*extensions.ThirdPartyResource)
object.Description = "new description"
return object
},

View File

@@ -52,7 +52,7 @@ func (strategy) PrepareForCreate(obj runtime.Object) {
}
func (strategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
return validation.ValidateThirdPartyResource(obj.(*experimental.ThirdPartyResource))
return validation.ValidateThirdPartyResource(obj.(*extensions.ThirdPartyResource))
}
func (strategy) AllowCreateOnUpdate() bool {
@@ -63,7 +63,7 @@ func (strategy) PrepareForUpdate(obj, old runtime.Object) {
}
func (strategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
return validation.ValidateThirdPartyResourceUpdate(old.(*experimental.ThirdPartyResource), obj.(*experimental.ThirdPartyResource))
return validation.ValidateThirdPartyResourceUpdate(old.(*extensions.ThirdPartyResource), obj.(*extensions.ThirdPartyResource))
}
func (strategy) AllowUnconditionalUpdate() bool {
@@ -73,7 +73,7 @@ func (strategy) AllowUnconditionalUpdate() bool {
// Matcher returns a generic matcher for a given label and field selector.
func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
return generic.MatcherFunc(func(obj runtime.Object) (bool, error) {
sa, ok := obj.(*experimental.ThirdPartyResource)
sa, ok := obj.(*extensions.ThirdPartyResource)
if !ok {
return false, fmt.Errorf("not a ThirdPartyResource")
}
@@ -83,6 +83,6 @@ func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
}
// SelectableFields returns a label set that can be used for filter selection
func SelectableFields(obj *experimental.ThirdPartyResource) labels.Set {
func SelectableFields(obj *extensions.ThirdPartyResource) labels.Set {
return labels.Set{}
}