weizhouapache commented on PR #8556:
URL: https://github.com/apache/cloudstack/pull/8556#issuecomment-1910671560
> > > > @GaOrtiga @DaanHoogland sorry this PR is not needed in my opinion
> > >
> > >
> > > Having a workaround should not be a reason to restrict an operation.
If the operator does not know that you can circumvent this restriction they may
feel obliged to perform the operation directly in the DB, especially since the
exception thrown is very vague and editing the template's type to make it
deletable is very non-intuitive.
> >
> > If the solution is not clear, make it clear then. for example
> >
> > ```
> > diff --git
a/server/src/main/java/com/cloud/template/HypervisorTemplateAdapter.java
b/server/src/main/java/com/cloud/template/HypervisorTemplateAdapter.java
> > index b886f0868f6..6456ca452ed 100644
> > ---
a/server/src/main/java/com/cloud/template/HypervisorTemplateAdapter.java
> > +++
b/server/src/main/java/com/cloud/template/HypervisorTemplateAdapter.java
> > @@ -749,7 +749,7 @@ public class HypervisorTemplateAdapter extends
TemplateAdapterBase {
> > TemplateProfile profile = super.prepareDelete(cmd);
> > VMTemplateVO template = profile.getTemplate();
> > if (template.getTemplateType() == TemplateType.SYSTEM) {
> > - throw new InvalidParameterValueException("The DomR template
cannot be deleted.");
> > + throw new InvalidParameterValueException("The SYSTEM
template cannot be deleted. Please update template type to USER and retry.");
> > }
> > checkZoneImageStores(profile.getTemplate(),
profile.getZoneIdList());
> > return profile;
> > ```
> @weizhouapache
> While the proposed implementation provides clarity, it's not intuitive.
Since changes are already necessary, instead of merely guiding users through an
arbitrary process, the aim should be to enhance overall code understanding and
user experience.
>
Can you tell me how frequent you deleted the SYSTEM template?
> The `force` flag should be more than enough to address any remaining
concerns. This flag serves as a clear indicator that the operation requires
careful execution and is not intended for routine use.
>
force flag is being used by other purpose.
> Besides, deleting the current `SYSTEM` template does not pose a
significant risk to the environment, as it can be reuploaded.
That is not true. Without SYSTEM template, users cannot create new networks
and recreate VRs/system vms. Do you think if it is a critical issue if it
happens on your production?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]