mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
Set uid during object create
This commit is contained in:
@@ -68,7 +68,7 @@ func (rs *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RE
|
||||
return nil, errors.NewInvalid("replicationController", controller.Name, errs)
|
||||
}
|
||||
|
||||
controller.CreationTimestamp = util.Now()
|
||||
api.FillObjectMetaSystemFields(ctx, &controller.ObjectMeta)
|
||||
|
||||
return apiserver.MakeAsync(func() (runtime.Object, error) {
|
||||
err := rs.registry.CreateController(ctx, controller)
|
||||
|
@@ -264,6 +264,9 @@ func TestCreateController(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if !api.HasObjectMetaSystemFieldValues(&controller.ObjectMeta) {
|
||||
t.Errorf("storage did not populate object meta field values")
|
||||
}
|
||||
|
||||
select {
|
||||
case <-channel:
|
||||
|
Reference in New Issue
Block a user