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 @@ -84,6 +84,10 @@ type TAppSpec struct {
8484 // Default values is false.
8585 ForceDeletePod bool `json:"forceDeletePod,omitempty"`
8686
87+ // AutoDeleteUnusedTemplate indicates whether auto delete templates when it is unused.
88+ // Default values is false.
89+ AutoDeleteUnusedTemplate bool `json:"autoDeleteUnusedTemplate,omitempty"`
90+
8791 // NeverMigrate indicates whether to migrate pods. If it is true, pods will never be migrated to
8892 // other nodes, otherwise it depends on other conditions(e.g. pod restart policy).
8993 NeverMigrate bool `json:"neverMigrate,omitempty"`
Original file line number Diff line number Diff line change @@ -491,6 +491,9 @@ func (c *Controller) setDefaultValue(tapp *tappv1.TApp) {
491491}
492492
493493func (c * Controller ) removeUnusedTemplate (tapp * tappv1.TApp ) error {
494+ if ! tapp .Spec .AutoDeleteUnusedTemplate {
495+ return nil
496+ }
494497 templateMap := make (map [string ]bool , len (tapp .Spec .TemplatePool ))
495498 for k := range tapp .Spec .TemplatePool {
496499 templateMap [k ] = true
You can’t perform that action at this time.
0 commit comments