mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 05:01:46 +00:00
rename ResetBeforeCreate to PrepareForCreate
This commit is contained in:
@@ -43,8 +43,8 @@ func (namespaceStrategy) NamespaceScoped() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ResetBeforeCreate clears fields that are not allowed to be set by end users on creation.
|
||||
func (namespaceStrategy) ResetBeforeCreate(obj runtime.Object) {
|
||||
// PrepareForCreate clears fields that are not allowed to be set by end users on creation.
|
||||
func (namespaceStrategy) PrepareForCreate(obj runtime.Object) {
|
||||
// on create, status is active
|
||||
namespace := obj.(*api.Namespace)
|
||||
namespace.Status = api.NamespaceStatus{
|
||||
|
@@ -33,7 +33,7 @@ func TestNamespaceStrategy(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Status: api.NamespaceStatus{Phase: api.NamespaceTerminating},
|
||||
}
|
||||
Strategy.ResetBeforeCreate(namespace)
|
||||
Strategy.PrepareForCreate(namespace)
|
||||
if namespace.Status.Phase != api.NamespaceActive {
|
||||
t.Errorf("Namespaces do not allow setting phase on create")
|
||||
}
|
||||
|
Reference in New Issue
Block a user