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 {
85
85
// Default values is false.
86
86
ForceDeletePod bool `json:"forceDeletePod,omitempty"`
87
87
88
+ // AutoDeleteUnusedTemplate indicates whether auto delete templates when it is unused.
89
+ // Default values is false.
90
+ AutoDeleteUnusedTemplate bool `json:"autoDeleteUnusedTemplate,omitempty"`
91
+
88
92
// NeverMigrate indicates whether to migrate pods. If it is true, pods will never be migrated to
89
93
// other nodes, otherwise it depends on other conditions(e.g. pod restart policy).
90
94
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) {
493
493
}
494
494
495
495
func (c * Controller ) removeUnusedTemplate (tapp * tappv1.TApp ) error {
496
+ if ! tapp .Spec .AutoDeleteUnusedTemplate {
497
+ return nil
498
+ }
496
499
templateMap := make (map [string ]bool , len (tapp .Spec .TemplatePool ))
497
500
for k := range tapp .Spec .TemplatePool {
498
501
templateMap [k ] = true
You can’t perform that action at this time.
0 commit comments