From e85f740f9c6f94c7040f08be887b7b6437416f6d Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Mon, 20 Sep 2021 18:38:14 +0200 Subject: [PATCH] F #5499: Add attribute LXC_UNPRIVILEGED on Sunstone (#1467) --- .../form-panels/create/wizard-tabs/general.js | 8 +++++++- .../create/wizard-tabs/general/html.hbs | 14 ++++++++++++++ src/sunstone/public/app/utils/custom-tags-table.js | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js index 349f490b0f..8504ef3e36 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general.js @@ -377,6 +377,10 @@ define(function(require) { templateJSON["VCENTER_VM_FOLDER"] = WizardFields.retrieveInput($("#vcenter_vm_folder", context)); } } + + if (templateJSON["HYPERVISOR"] == "lxc"){ + templateJSON["LXC_UNPRIVILEGED"] = $("#lxc_security_privileged", context).val().toUpperCase(); + } var sunstone_template = {}; @@ -502,7 +506,9 @@ define(function(require) { } // LXC specific attributes - if (templateJSON["HYPERVISOR"] == "lxc") {} + if (templateJSON["HYPERVISOR"] == "lxc") { + $("#lxc_security_privileged").val(templateJSON["LXC_UNPRIVILEGED"].toLowerCase()); + } if (templateJSON["HYPERVISOR"]) { $("input[name='hypervisor'][value='"+templateJSON["HYPERVISOR"]+"']", context).trigger("click"); diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs index f8f5ce7d57..b7d88e8782 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs @@ -121,6 +121,20 @@ + {{#isFeatureEnabled "showback"}}
diff --git a/src/sunstone/public/app/utils/custom-tags-table.js b/src/sunstone/public/app/utils/custom-tags-table.js index 8ad187ef25..aacbc0dfa4 100644 --- a/src/sunstone/public/app/utils/custom-tags-table.js +++ b/src/sunstone/public/app/utils/custom-tags-table.js @@ -28,7 +28,7 @@ define(function(require) { var showMandatory = false; var showDefault = false; - var deleteTags = ["VCENTER_CUSTOMIZATION_SPEC"]; + var deleteTags = ["VCENTER_CUSTOMIZATION_SPEC", "LXC_UNPRIVILEGED"]; function _reset(){ showDefault = false;