Add some blocking so that we don't generate identical UUIDs for API objects.

This commit is contained in:
Brendan Burns
2014-11-01 22:11:05 -07:00
parent bbb66af3db
commit a624630112
3 changed files with 48 additions and 5 deletions

View File

@@ -28,8 +28,6 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
"code.google.com/p/go-uuid/uuid"
)
// PodLister is anything that knows how to list pods.
@@ -64,7 +62,7 @@ func (rs *REST) Create(ctx api.Context, obj runtime.Object) (<-chan apiserver.RE
}
if len(controller.Name) == 0 {
controller.Name = uuid.NewUUID().String()
controller.Name = util.NewUUID().String()
}
// Pod Manifest ID should be assigned by the pod API
controller.DesiredState.PodTemplate.DesiredState.Manifest.ID = ""