-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use UUID to ensure the uniqueness of job template name #16672
Conversation
715147d
to
564d891
Compare
end | ||
|
||
private | ||
|
||
def build_parameter_list(options) | ||
params = { | ||
:name => options[:template_name] || "#{name}_#{Time.zone.now.to_i}", | ||
:name => options[:template_name] || "#{name}_#{SecureRandom.uuid}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzwei I like this change. Thinking we should add the time to the description so we have a reference if needed.
564d891
to
1906989
Compare
Checked commit bzwei@1906989 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. I like the time stamp for the description ( as suggested by @gmcculloug )
Use UUID to ensure the uniqueness of job template name (cherry picked from commit 80c69ec) https://bugzilla.redhat.com/show_bug.cgi?id=1527560
Gaprindashvili backport details:
|
When we create job template (and inventory) to run a playbook, a timestamp was appended to the name to ensure the name uniqueness at the tower side. For the setup reported in the BZ after multiple VM provisioning completed they all tried to run the same playbook at the same second, causing a naming collision.
The solution is to replace the timestamp with a UUID.
fixes https://bugzilla.redhat.com/show_bug.cgi?id=1525683