File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ type TAppSpec struct {
8585 // Default values is false.
8686 ForceDeletePod bool `json:"forceDeletePod,omitempty"`
8787
88+ // AutoDeleteUnusedTemplate indicates whether auto delete templates when it is unused.
89+ // Default values is false.
90+ AutoDeleteUnusedTemplate bool `json:"autoDeleteUnusedTemplate,omitempty"`
91+
8892 // NeverMigrate indicates whether to migrate pods. If it is true, pods will never be migrated to
8993 // other nodes, otherwise it depends on other conditions(e.g. pod restart policy).
9094 NeverMigrate bool `json:"neverMigrate,omitempty"`
Original file line number Diff line number Diff line change @@ -493,6 +493,9 @@ func (c *Controller) setDefaultValue(tapp *tappv1.TApp) {
493493}
494494
495495func (c * Controller ) removeUnusedTemplate (tapp * tappv1.TApp ) error {
496+ if ! tapp .Spec .AutoDeleteUnusedTemplate {
497+ return nil
498+ }
496499 templateMap := make (map [string ]bool , len (tapp .Spec .TemplatePool ))
497500 for k := range tapp .Spec .TemplatePool {
498501 templateMap [k ] = true
You can’t perform that action at this time.
0 commit comments