Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Some e2e util functions are not generating unique numbers properly #1344

Closed
shaominchen opened this issue Jun 2, 2017 · 3 comments
Closed
Assignees
Milestone

Comments

@shaominchen
Copy link
Contributor

shaominchen commented Jun 2, 2017

The following util functions are buggy:

  1. GetVolumeNameWithTimeStamp
  2. GetContainerNameWithTimeStamp
  3. GetServiceNameWithTimeStamp

The intention of these functions is to generate a unique name, but we are using time.Now().Unix() which generates a number based on the same timestamp in seconds. The generated number will not be unique if we call this function multiple times in a short period or from different goroutines. It won't work even if we change it to time.Now().UnixNano().

We should fix these functions to use random number generator.

@shuklanirdesh82
Copy link
Contributor

yeah @govint pointed out today #1310 (comment)

@ashahi1
Copy link
Contributor

ashahi1 commented Jun 2, 2017

I know, its a trivial issue and I will take care of it.

@ashahi1
Copy link
Contributor

ashahi1 commented Jun 9, 2017

Fixing it in PR #1385

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants