-
Notifications
You must be signed in to change notification settings - Fork 896
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
Apply dialog tags to VMs created during orchestration provisioning #16299
Apply dialog tags to VMs created during orchestration provisioning #16299
Conversation
tag_ids = provisioning_tag_ids | ||
return if tag_ids.empty? | ||
|
||
vm_ids = direct_vms.collect(&:id) |
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.
Although direct_vms
and all_vms
return the same, isn't all_vms
more meaningful?
tag_sequence = match[:sequence].to_i | ||
value.scan(DIALOG_TAG_VALUE_REGEX).flatten if tag_sequence.zero? || tag_sequence == provision_sequence | ||
end | ||
end.compact.map!(&:to_i) |
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.
They don't need to be converted to integers, do they?
998c849
to
b05499b
Compare
@bzwei Updated based on your comments. |
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.
LGTM. I think the test failure is not relevant.
@mkanoor @tinaafitz Please review. Tests are green now. |
end | ||
end | ||
|
||
context `with a vm` do |
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.
@gmcculloug Should these be apostrophes or a back tick.
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.
Good catch, my markdown past haunts me. I'll clean up both, thanks.
context `with a vm` do | ||
before { expect(service).to receive(:all_vms).and_return([vm]) } | ||
|
||
context `with a single service and dialog tag options` do |
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.
@gmcculloug apostrophe?
b05499b
to
195afd5
Compare
Checked commit gmcculloug@195afd5 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.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.
@gmcculloug looks good.
VM Lifecycle provisioning (and associated service provisioning) allow users to select tags and those tags are automatically applied to the resulting VMs. Orchestration provisioning supports tag select, through service dialogs, but the resulting VMs do not have the tags applied as part of the post provisioning steps.
This PR uses the standard dialog field naming scheme (dialog_tag__) to determine which tags are applied to the created VMs.
For example:
dialog_tag_0_env
would apply the selected tag (or tags for multi-select tag categories) to all VMs created for a single service or bundle service provision request.dialog_tag_1_env
tags would apply to VMs created during a single service provision or a service provisioned in a bundle with a provisioning order of 1.dialog_tag_2_env
tags would only be applied to VMs that belong to a service that is part of a bundle and have a provisioning order of 2.Links [Optional]