rename ResetBeforeCreate to PrepareForCreate
This commit is contained in:
@@ -43,8 +43,8 @@ func (resourcequotaStrategy) NamespaceScoped() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// ResetBeforeCreate clears fields that are not allowed to be set by end users on creation.
|
||||
func (resourcequotaStrategy) ResetBeforeCreate(obj runtime.Object) {
|
||||
// PrepareForCreate clears fields that are not allowed to be set by end users on creation.
|
||||
func (resourcequotaStrategy) PrepareForCreate(obj runtime.Object) {
|
||||
resourcequota := obj.(*api.ResourceQuota)
|
||||
resourcequota.Status = api.ResourceQuotaStatus{}
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ func TestResourceQuotaStrategy(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
Strategy.ResetBeforeCreate(resourceQuota)
|
||||
Strategy.PrepareForCreate(resourceQuota)
|
||||
if resourceQuota.Status.Used != nil {
|
||||
t.Errorf("ResourceQuota does not allow setting status on create")
|
||||
}
|
||||
|
Reference in New Issue
Block a user