mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #264 from brendandburns/padding
Set id width at 8 and pad with zeros.
This commit is contained in:
commit
ab308ad13a
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user