diff --git a/pkg/controller/replication_controller.go b/pkg/controller/replication_controller.go index 7fa568ae27b..e156247e544 100644 --- a/pkg/controller/replication_controller.go +++ b/pkg/controller/replication_controller.go @@ -62,7 +62,7 @@ func (r RealPodControl) createReplica(controllerSpec api.ReplicationController) } pod := api.Pod{ JSONBase: api.JSONBase{ - ID: fmt.Sprintf("%x", rand.Int()), + ID: fmt.Sprintf("%08x", rand.Uint32()), }, DesiredState: controllerSpec.DesiredState.PodTemplate.DesiredState, Labels: controllerSpec.DesiredState.PodTemplate.Labels, diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 40e3c9be139..8467f333ee0 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -263,7 +263,7 @@ const containerNamePrefix = "k8s" // Creates a name which can be reversed to identify both manifest id and container name. func manifestAndContainerToDockerName(manifest *api.ContainerManifest, container *api.Container) string { // Note, manifest.Id could be blank. - return fmt.Sprintf("%s--%s--%s--%x", containerNamePrefix, escapeDash(container.Name), escapeDash(manifest.Id), rand.Uint32()) + return fmt.Sprintf("%s--%s--%s--%08x", containerNamePrefix, escapeDash(container.Name), escapeDash(manifest.Id), rand.Uint32()) } // Upacks a container name, returning the manifest id and container name we would have used to