Rebased and updated
This commit is contained in:
@@ -56,7 +56,7 @@ func NewStorage(h tools.EtcdHelper) *REST {
|
||||
}
|
||||
|
||||
store.CreateStrategy = persistentvolumeclaim.Strategy
|
||||
store.UpdateStrategy = persistentvolumeclaim.Strategy
|
||||
store.UpdateStrategy = persistentvolumeclaim.StatusStrategy
|
||||
store.ReturnDeletedObject = true
|
||||
|
||||
return &REST{store}
|
||||
|
@@ -57,7 +57,7 @@ func (persistentvolumeclaimStrategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
}
|
||||
|
||||
// Validate validates a new persistentvolumeclaim.
|
||||
func (persistentvolumeclaimStrategy) Validate(obj runtime.Object) fielderrors.ValidationErrorList {
|
||||
func (persistentvolumeclaimStrategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
|
||||
pvc := obj.(*api.PersistentVolumeClaim)
|
||||
return validation.ValidatePersistentVolumeClaim(pvc)
|
||||
}
|
||||
@@ -67,11 +67,6 @@ func (persistentvolumeclaimStrategy) AllowCreateOnUpdate() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
func (persistentvolumeclaimStrategy) ValidateUpdate(obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
return validation.ValidatePersistentVolumeClaimUpdate(obj.(*api.PersistentVolumeClaim), old.(*api.PersistentVolumeClaim))
|
||||
}
|
||||
|
||||
type persistentvolumeclaimStatusStrategy struct {
|
||||
persistentvolumeclaimStrategy
|
||||
}
|
||||
@@ -84,7 +79,7 @@ func (persistentvolumeclaimStatusStrategy) PrepareForUpdate(obj, old runtime.Obj
|
||||
newPvc.Spec = oldPvc.Spec
|
||||
}
|
||||
|
||||
func (persistentvolumeclaimStatusStrategy) ValidateUpdate(obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
func (persistentvolumeclaimStatusStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
return validation.ValidatePersistentVolumeClaimStatusUpdate(obj.(*api.PersistentVolumeClaim), old.(*api.PersistentVolumeClaim))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user