-
Notifications
You must be signed in to change notification settings - Fork 366
Add terraform template catalog #9194
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
Conversation
6fdc81e to
f2b5373
Compare
72ec4b0 to
0a27776
Compare
| if prov_type == 'generic_terraform_template' | ||
| @current_region = MiqRegion.my_region.region | ||
| end | ||
| prov_type == 'generic_terraform_template' |
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.
These methods are nearly identical. Can we try to refactor them? It's also odd that a predicate/query/boolean method would set the @current_region as a side effect. I understand if this was the existing code for ansible but we should really try to fix that.
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.
I can fix this in a follow up pr since I don't want to risk breaking the Ansible Playbook forms and the rest of this pr is pretty much done
a81b6fe to
0d02c09
Compare
04f603f to
c7c63b5
Compare
|
kicking failed ci jobs |
| # if @record.config_info[:retirement] | ||
| # retirement = @record.config_info[:retirement] | ||
| # terraform_template_details[:retirement] = {} | ||
| # terraform_template_details[:retirement][:remove_resources] = retirement[:remove_resources] | ||
| # if retirement[:repository_id] | ||
| # terraform_template_details[:retirement][:repository] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::ConfigurationScriptSource, retirement[:repository_id]) | ||
| # terraform_template_details[:retirement][:template] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::ConfigurationScriptPayload, retirement[:configuration_script_payload_id]) | ||
| # terraform_template_details[:retirement][:credential] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::Credential, retirement[:credential_id]) | ||
| # terraform_template_details[:retirement][:network_credential] = fetch_name_from_object(ManageIQ::Providers::EmbeddedTerraform::AutomationManager::NetworkCredential, retirement[:network_credential_id]) if retirement[:network_credential_id] | ||
| # end | ||
| # terraform_template_details[:retirement][:execution_ttl] = retirement[:execution_ttl] | ||
| # terraform_template_details[:retirement][:verbosity] = retirement[:verbosity] | ||
| # terraform_template_details[:retirement][:log_output] = retirement[:log_output] | ||
| # terraform_template_details[:retirement][:become_enabled] = retirement[:become_enabled] == true ? _('Yes') : _('No') | ||
| # end |
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.
Minor but I think we should add a comment here about why this block of code is commented out
|
@GilbertCherrie can you add some screenshots of the new page to the PR description? |
|
Also the spec failures look related to these changes |
913a6d6 to
3ce5e2a
Compare
3ce5e2a to
1cb6906
Compare
|
Checked commit GilbertCherrie@1cb6906 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint app/views/catalog/_tt_react_form.html.haml |
|
Backported to |
Add terraform template catalog (cherry picked from commit 64b9d6d)
| /** button component used as a mapper to copy the provision details into retirement */ | ||
| // export const CopyFromProvisonButton = (props) => { | ||
| // const { label, copyFrom, copyTo } = useFieldApi(props); | ||
| // const formOptions = useFormApi(); | ||
| // const handleClick = () => { | ||
| // copyFrom.forEach((fromItem, i) => { | ||
| // const destination = `config_info.retirement.${copyTo[i]}`; | ||
| // formOptions.change(destination, formOptions.getState().values.config_info.provision[fromItem]); | ||
| // }); | ||
| // }; | ||
| // return ( | ||
| // <div> | ||
| // <Button kind="secondary" onClick={handleClick}>{label}</Button> | ||
| // </div> | ||
| // ); | ||
| // }; |
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.
Hey @GilbertCherrie , we can remove this if not needed..
| // if (Object.prototype.hasOwnProperty.call(catalogData.config_info.retirement, 'extra_vars')) { | ||
| // catalogData.config_info.retirement.extra_vars = convertObject(catalogData.config_info.retirement.extra_vars); | ||
| // } |
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 too..
Added the add / edit and summary screen for the terraform template catalog item.
Add Terraform Template Catalog Item:


Edit Terraform Template Catalog Item:


Summary Screen:
