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

@@ -56,9 +56,9 @@ type REST struct {
func NewREST(s storage.Interface) *REST {
prefix := "/deployments"
store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &experimental.Deployment{} },
NewFunc: func() runtime.Object { return &extensions.Deployment{} },
// NewListFunc returns an object capable of storing results of an etcd list.
NewListFunc: func() runtime.Object { return &experimental.DeploymentList{} },
NewListFunc: func() runtime.Object { return &extensions.DeploymentList{} },
// Produces a path that etcd understands, to the root of the resource
// by combining the namespace in the context with the given prefix.
KeyRootFunc: func(ctx api.Context) string {
@@ -71,7 +71,7 @@ func NewREST(s storage.Interface) *REST {
},
// Retrieve the name field of a deployment.
ObjectNameFunc: func(obj runtime.Object) (string, error) {
return obj.(*experimental.Deployment).Name, nil
return obj.(*extensions.Deployment).Name, nil
},
// Used to match objects based on labels/fields for list.
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
@@ -99,7 +99,7 @@ var _ = rest.Patcher(&ScaleREST{})
// New creates a new Scale object
func (r *ScaleREST) New() runtime.Object {
return &experimental.Scale{}
return &extensions.Scale{}
}
func (r *ScaleREST) Get(ctx api.Context, name string) (runtime.Object, error) {
@@ -107,16 +107,16 @@ func (r *ScaleREST) Get(ctx api.Context, name string) (runtime.Object, error) {
if err != nil {
return nil, errors.NewNotFound("scale", name)
}
return &experimental.Scale{
return &extensions.Scale{
ObjectMeta: api.ObjectMeta{
Name: name,
Namespace: deployment.Namespace,
CreationTimestamp: deployment.CreationTimestamp,
},
Spec: experimental.ScaleSpec{
Spec: extensions.ScaleSpec{
Replicas: deployment.Spec.Replicas,
},
Status: experimental.ScaleStatus{
Status: extensions.ScaleStatus{
Replicas: deployment.Status.Replicas,
Selector: deployment.Spec.Selector,
},
@@ -127,7 +127,7 @@ func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object,
if obj == nil {
return nil, false, errors.NewBadRequest(fmt.Sprintf("nil update passed to Scale"))
}
scale, ok := obj.(*experimental.Scale)
scale, ok := obj.(*extensions.Scale)
if !ok {
return nil, false, errors.NewBadRequest(fmt.Sprintf("wrong object passed to Scale update: %v", obj))
}
@@ -140,16 +140,16 @@ func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object,
if err != nil {
return nil, false, errors.NewConflict("scale", scale.Name, err)
}
return &experimental.Scale{
return &extensions.Scale{
ObjectMeta: api.ObjectMeta{
Name: deployment.Name,
Namespace: deployment.Namespace,
CreationTimestamp: deployment.CreationTimestamp,
},
Spec: experimental.ScaleSpec{
Spec: extensions.ScaleSpec{
Replicas: deployment.Spec.Replicas,
},
Status: experimental.ScaleStatus{
Status: extensions.ScaleStatus{
Replicas: deployment.Status.Replicas,
Selector: deployment.Spec.Selector,
},