Description of problem: Importing the 'Core Domains' with a different name creates a new Core Domain which should not be permitted as Red Hat CloudForms have only two Core Domain i.e RedHat and ManageIQ Version-Release number of selected component (if applicable): Red Hat CloudForms 4.7 How reproducible: Always with the below steps. Steps to Reproduce: 1 Export the appliance domain as a zip file 2 Extracted the ManageIQ directory to a new dir on the local machine called Domain_Test02 3 From within the new Domain_Test02 dir, edit the __domain__.yaml file so that the 'name' attribute equals Domain_Test02 NOTE: Do not change the 'source' attribute from 'system' to 'user' this time. 4 Archived the new Domain_Test02 dir and upload to CloudForms Appliance Actual results: The imported domain is a New Core Domian like RedHat and ManageIQ domain those can not be deleted and edited. The new domain behaviour is similar to Core Domains Expected results: The imported domains should be Custom Domains Is there any other way to forcefully delete the Core/Base Domain ? Additional info: - Modifying the `Source = user` attribute in the yaml file and re-importing everything but 'Domain_Test02' is still marked as locked. - Editing the __domain__.yaml before importing to `Source = user` creates no problem
Hi Khushbu, >> Is there any other way to forcefully delete the Core/Base Domain ? We can delete locked domains via rails: ssh to appliance and perform: [root@vm253-117 vmdb]# bin/rails c irb(main):001:0> MiqAeDomain.first (check output this command and see if you want to delete that domain or try second, third etc options to get particular domain) irb(main):002:0> MiqAeDomain.first.delete [root@vm253-117 vmdb]# bin/rake evm:automate:reset Resetting the default domains in the automation model The default domains in the automation model have been reset. Please let me know, if it works or not. Thanks, Ganesh
Hello Ganesh, Thank you so much for the prompt reply. This works and I have updated the CU about the same. Thank you so very much !! Regards, Khushbu
Hi Khushbu, Can you write a KB article to explain how to manually delete a 'system' domain added by mistake, and can we close this ticket? Let me know if you have any questions. Thanks, Tina
Hi Patrik, Can you investigate how difficult it would be to issue a warning message if the domain being imported is a 'system' domain? Thanks, Tina
Hi Patrik, As we discussed earlier this week, we should prevent a system domain (other than our system domains) from being imported. Can you look into the code that is used to "Reset all components in the following domains: RedHat, ManageIQ" to determine if the system domain is ours? Let me know if you have any questions. Thanks, Tina
Hi Tina. This is the logic you were asking for: https://github.com/ManageIQ/manageiq-automation_engine/blob/master/app/models/miq_ae_datastore.rb#L176-L209. So if you add some new system domain, it wont be added into the result of `MiqAeDatastore.default_domain_names` method. I am not sure what is the best way here. We can validate the imported domains by name and keep system domain import only for domains with name from `MiqAeDatastore.default_domain_names`. Is this validation enough? What do you think?
Hi Patrik, Yes, checking the domain name against MiqAeDatastore.default_domain_names is validation enough when trying to import a system domain. Let me know if you have any questions. Thanks, Tina
solved in https://github.com/ManageIQ/manageiq-automation_engine/pull/395.
New commit detected on ManageIQ/manageiq-automation_engine/ivanchuk: https://github.com/ManageIQ/manageiq-automation_engine/commit/2fe6402c889b028e532c439a03d2e3e6859e1449 commit 2fe6402c889b028e532c439a03d2e3e6859e1449 Author: tina <tfitzger> AuthorDate: Wed Dec 18 16:19:57 2019 +0000 Commit: Satoe Imaishi <simaishi> CommitDate: Thu Jul 2 17:34:37 2020 +0000 Merge pull request #395 from pkomanek/reworking_automate_datastore_import_validation Changing the automate datastore import validation. (cherry picked from commit 8c1497c4142656643340cd0f1ec2b7232b24bda3) https://bugzilla.redhat.com/show_bug.cgi?id=1753586 app/models/miq_ae_git_import.rb | 5 +- app/models/miq_ae_yaml_import.rb | 29 +- spec/models/miq_ae_git_import_spec.rb | 2 +- spec/models/miq_ae_yaml_import_spec.rb | 133 +- 4 files changed, 162 insertions(+), 7 deletions(-)
New commit detected on ManageIQ/manageiq-ui-classic/ivanchuk: https://github.com/ManageIQ/manageiq-ui-classic/commit/75d94a0adb8c7be8568325fde15aef1d42c93b1e commit 75d94a0adb8c7be8568325fde15aef1d42c93b1e Author: Martin Povolny <mpovolny> AuthorDate: Fri Jan 10 09:10:34 2020 +0000 Commit: Satoe Imaishi <simaishi> CommitDate: Thu Jul 2 17:42:38 2020 +0000 Merge pull request #6434 from pkomanek/refactoring_automate_import_error_messages Refactoring automate import error messages. (cherry picked from commit 298b657bb0827fc8c72eec8bd47e9b0be6e09da1) https://bugzilla.redhat.com/show_bug.cgi?id=1753586 app/controllers/miq_ae_tools_controller.rb | 6 +- app/services/git_based_domain_import_service.rb | 12 +- spec/controllers/miq_ae_tools_controller_spec.rb | 4 +- spec/services/git_based_domain_import_service_spec.rb | 8 +- 4 files changed, 11 insertions(+), 19 deletions(-)
After discussing with Tina, I've also backported https://github.com/ManageIQ/manageiq-automation_engine/pull/355 as a PR needed for this BZ depends on it. When testing this BZ, please make sure PR355 is also tested. Thank you!
Verified on 5.11.7.0.20200714215453_0da8a4a Performed below steps to Verification: - Exported domain by navigating Automation>Automate>(Import/Export) - On completion of downloading, untar fail and edited ManageIQ domain by changing name - made zip file only for ManageIQ domain by giving on_qa-zip - upload on-qa.zip file by navigating Automation>Automate>(Import/Export) - Once upload done selected all available namespaces and clicked on commit button. After performing all above steps got expected error that is system domain is not supported.
Created attachment 1701350 [details] Adding screenshot of verification
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Critical: CloudForms 5.0.7 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:3358