Skip to content

Commit 225080e

Browse files
feat(cleanup): make cleanup defaults more aggressive
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
1 parent 9127024 commit 225080e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/pages_en/usage/cleanup/cr_cleanup.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ cleanup:
138138
- references:
139139
branch: /^(main|master|staging|production)$/
140140
imagesPerReference:
141-
last: 10
141+
last: 2
142142
```
143143

144144
Let’s break down each policy separately. For each image in werf.yaml:
145145

146146
1. Keep by **one version** for **the last 10 Git tags** (based on the HEAD commit creation date).
147-
2. Keep by **up to two versions** from **the past week** for **the 10 most active Git branches** (based on the HEAD commit creation date).
148-
3. Keep by **the last 10 versions** for **the Git branches main, master, staging, and production**.
147+
2. Keep by **up to two versions** from **the past week** for **the 10 most active Git branches** within that period (based on the HEAD commit creation date).
148+
3. Keep by **two versions** for **the Git branches main, master, staging, and production**.
149149

150150
### Disabling policies
151151

docs/pages_ru/usage/cleanup/cr_cleanup.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ cleanup:
138138
- references:
139139
branch: /^(main|master|staging|production)$/
140140
imagesPerReference:
141-
last: 10
141+
last: 2
142142
```
143143

144144
Разберём каждую политику по отдельности. Для каждого образа из werf.yaml:
145145

146146
1. Хранить по **одной версии** для **10 последних git-тегов** (по дате создания HEAD-коммита).
147-
2. Хранить по **не более чем, две версии**, **собранные за последнюю неделю**, для **10 активных git-веток** (по дате создания HEAD-коммита).
148-
3. Хранить по **10 последних версий** для **git-веток main, master, staging и production**.
147+
2. Хранить по **не более чем, две версии**, **собранные за последнюю неделю**, для **10 активных git-веток** в этот период (по дате создания HEAD-коммита).
148+
3. Хранить по **две версии** для **git-веток main, master, staging и production**.
149149

150150
### Отключение политик
151151

pkg/cleaning/git_history_based_cleanup/reference_to_scan.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func ReferencesToScan(ctx context.Context, gitRepository *git.Repository, keepPo
148148
),
149149
})
150150

151-
mainBranchImagesPerReferenceLast := 10
151+
mainBranchImagesPerReferenceLast := 2
152152
keepPolicies = append(keepPolicies, &config.MetaCleanupKeepPolicy{
153153
References: config.MetaCleanupKeepPolicyReferences{
154154
BranchRegexp: regexp.MustCompile("^(main|master|staging|production)$"),

0 commit comments

Comments
 (0)