Skip to content

Commit 2414b23

Browse files
feat(host-cleanup): support Buildah backend (#6575)
Signed-off-by: Alexandr Zaytsev <alexandr.zaytsev@flant.com> Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com> Co-authored-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
1 parent 8d4e06c commit 2414b23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1222
-371
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/.vscode
55
/.idea
66
/.run
7+
/.help
78

89
/docs/vendor
910
/docs/.ruby-version

Taskfile.dist.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ tasks:
434434
cmds:
435435
- go generate -run mockgen ./cmd/... ./pkg/...
436436

437+
enum:generate:
438+
desc: "Generate enums."
439+
cmds:
440+
- go generate -run enumer ./cmd/... ./pkg/...
441+
437442
doc:
438443
desc: "Run all docs generators, formatters and linters."
439444
cmds:
@@ -565,6 +570,11 @@ tasks:
565570
cmds:
566571
- go install go.uber.org/mock/mockgen@v0.5.0
567572

573+
deps:install:enumer:
574+
desc: "Install enumer library."
575+
cmds:
576+
- go install github.com/dmarkham/enumer@v1.5.11
577+
568578
sign:
569579
desc: 'Sign last version tag + origin/main and push signatures. Important vars: "refs".'
570580
cmds:

cmd/werf/build/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ func NewCmd(ctx context.Context) *cobra.Command {
105105
common.SetupFollow(&commonCmdData, cmd)
106106

107107
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
108-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
109-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
108+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
109+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
110110
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
111111
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
112-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
112+
common.SetupBackendStoragePath(&commonCmdData, cmd)
113113

114114
commonCmdData.SetupPlatform(cmd)
115115

cmd/werf/bundle/publish/publish.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ func NewCmd(ctx context.Context) *cobra.Command {
136136
common.SetupParallelOptions(&commonCmdData, cmd, common.DefaultBuildParallelTasksLimit)
137137

138138
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
139-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
140-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
139+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
140+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
141141
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
142142
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
143-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
143+
common.SetupBackendStoragePath(&commonCmdData, cmd)
144144

145145
common.SetupRequireBuiltImages(&commonCmdData, cmd)
146146
commonCmdData.SetupPlatform(cmd)

cmd/werf/cleanup/cleanup.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ func NewCmd(ctx context.Context) *cobra.Command {
8888
common.SetupKeepStagesBuiltWithinLastNHours(&commonCmdData, cmd)
8989

9090
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
91-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
92-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
91+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
92+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
9393
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
9494
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
95-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
95+
common.SetupBackendStoragePath(&commonCmdData, cmd)
9696
commonCmdData.SetupPlatform(cmd)
9797

9898
// aliases, but only WERF_SCAN_ONLY_CONTEXT env var is supported

cmd/werf/common/cmd_data.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ type CmdData struct {
122122
ScanContextNamespaceOnly *bool
123123

124124
// Host storage cleanup options
125-
DisableAutoHostCleanup *bool
126-
DockerServerStoragePath *string
127-
AllowedDockerStorageVolumeUsage *uint
128-
AllowedDockerStorageVolumeUsageMargin *uint
129-
AllowedLocalCacheVolumeUsage *uint
130-
AllowedLocalCacheVolumeUsageMargin *uint
125+
DisableAutoHostCleanup *bool
126+
BackendStoragePath *string
127+
AllowedBackendStorageVolumeUsage *uint
128+
AllowedBackendStorageVolumeUsageMargin *uint
129+
AllowedLocalCacheVolumeUsage *uint
130+
AllowedLocalCacheVolumeUsageMargin *uint
131131

132132
Platform *[]string
133133
}

cmd/werf/common/host_cleanup.go

+99-33
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import (
1010
"github.com/werf/common-go/pkg/util"
1111
"github.com/werf/werf/v2/pkg/container_backend"
1212
"github.com/werf/werf/v2/pkg/host_cleaning"
13+
"github.com/werf/werf/v2/pkg/util/option"
1314
)
1415

1516
func RunAutoHostCleanup(ctx context.Context, cmdData *CmdData, containerBackend container_backend.ContainerBackend) error {
1617
if *cmdData.DisableAutoHostCleanup {
1718
return nil
1819
}
1920

20-
if *cmdData.AllowedDockerStorageVolumeUsageMargin >= *cmdData.AllowedDockerStorageVolumeUsage {
21-
return fmt.Errorf("incompatible params --allowed-docker-storage-volume-usage=%d and --allowed-docker-storage-volume-usage-margin=%d: margin percentage should be less than allowed volume usage level percentage", *cmdData.AllowedDockerStorageVolumeUsage, *cmdData.AllowedDockerStorageVolumeUsageMargin)
21+
if *cmdData.AllowedBackendStorageVolumeUsageMargin >= *cmdData.AllowedBackendStorageVolumeUsage {
22+
return fmt.Errorf("incompatible params --allowed-backend-storage-volume-usage=%d and --allowed-backend-storage-volume-usage-margin=%d: margin percentage should be less than allowed volume usage level percentage", *cmdData.AllowedBackendStorageVolumeUsage, *cmdData.AllowedBackendStorageVolumeUsageMargin)
2223
}
2324

2425
if *cmdData.AllowedLocalCacheVolumeUsageMargin >= *cmdData.AllowedLocalCacheVolumeUsage {
@@ -29,11 +30,11 @@ func RunAutoHostCleanup(ctx context.Context, cmdData *CmdData, containerBackend
2930
HostCleanupOptions: host_cleaning.HostCleanupOptions{
3031
DryRun: false,
3132
Force: false,
32-
AllowedDockerStorageVolumeUsagePercentage: cmdData.AllowedDockerStorageVolumeUsage,
33-
AllowedDockerStorageVolumeUsageMarginPercentage: cmdData.AllowedDockerStorageVolumeUsageMargin,
34-
AllowedLocalCacheVolumeUsagePercentage: cmdData.AllowedLocalCacheVolumeUsage,
35-
AllowedLocalCacheVolumeUsageMarginPercentage: cmdData.AllowedLocalCacheVolumeUsageMargin,
36-
DockerServerStoragePath: cmdData.DockerServerStoragePath,
33+
AllowedBackendStorageVolumeUsagePercentage: cmdData.AllowedBackendStorageVolumeUsage,
34+
AllowedBackendStorageVolumeUsageMarginPercentage: cmdData.AllowedBackendStorageVolumeUsageMargin,
35+
AllowedLocalCacheVolumeUsagePercentage: cmdData.AllowedLocalCacheVolumeUsage,
36+
AllowedLocalCacheVolumeUsageMarginPercentage: cmdData.AllowedLocalCacheVolumeUsageMargin,
37+
BackendStoragePath: cmdData.BackendStoragePath,
3738
},
3839
})
3940
}
@@ -43,43 +44,108 @@ func SetupDisableAutoHostCleanup(cmdData *CmdData, cmd *cobra.Command) {
4344
cmd.Flags().BoolVarP(cmdData.DisableAutoHostCleanup, "disable-auto-host-cleanup", "", util.GetBoolEnvironmentDefaultFalse("WERF_DISABLE_AUTO_HOST_CLEANUP"), "Disable auto host cleanup procedure in main werf commands like werf-build, werf-converge and other (default disabled or WERF_DISABLE_AUTO_HOST_CLEANUP)")
4445
}
4546

46-
func SetupAllowedDockerStorageVolumeUsage(cmdData *CmdData, cmd *cobra.Command) {
47-
envVarName := "WERF_ALLOWED_DOCKER_STORAGE_VOLUME_USAGE"
48-
49-
var defaultVal uint
50-
if v := GetUint64EnvVarStrict(envVarName); v != nil {
51-
defaultVal = uint(*v)
52-
} else {
53-
defaultVal = uint(host_cleaning.DefaultAllowedDockerStorageVolumeUsagePercentage)
47+
func SetupAllowedBackendStorageVolumeUsage(cmdData *CmdData, cmd *cobra.Command) {
48+
aliases := []struct {
49+
ParamName string
50+
EnvName string
51+
}{
52+
{"allowed-backend-storage-volume-usage", "WERF_ALLOWED_BACKEND_STORAGE_VOLUME_USAGE"},
53+
{"allowed-docker-storage-volume-usage", "WERF_ALLOWED_DOCKER_STORAGE_VOLUME_USAGE"},
5454
}
55+
56+
defaultValUint64 := option.PtrValueOrDefault(GetUint64EnvVarStrict(aliases[0].EnvName),
57+
// keep backward compatibility
58+
option.PtrValueOrDefault(GetUint64EnvVarStrict(aliases[1].EnvName),
59+
uint64(host_cleaning.DefaultAllowedBackendStorageVolumeUsagePercentage)))
60+
61+
defaultVal := uint(defaultValUint64)
62+
5563
if defaultVal > 100 {
56-
TerminateWithError(fmt.Sprintf("bad %s value: specify percentage between 0 and 100", envVarName), 1)
64+
TerminateWithError(fmt.Sprintf("bad %s value: specify percentage between 0 and 100", aliases[0].EnvName), 1)
5765
}
5866

59-
cmdData.AllowedDockerStorageVolumeUsage = new(uint)
60-
cmd.Flags().UintVarP(cmdData.AllowedDockerStorageVolumeUsage, "allowed-docker-storage-volume-usage", "", defaultVal, fmt.Sprintf("Set allowed percentage of docker storage volume usage which will cause cleanup of least recently used local docker images (default %d%% or $%s)", uint(host_cleaning.DefaultAllowedDockerStorageVolumeUsagePercentage), envVarName))
61-
}
67+
cmdData.AllowedBackendStorageVolumeUsage = new(uint)
6268

63-
func SetupAllowedDockerStorageVolumeUsageMargin(cmdData *CmdData, cmd *cobra.Command) {
64-
envVarName := "WERF_ALLOWED_DOCKER_STORAGE_VOLUME_USAGE_MARGIN"
69+
for _, alias := range aliases {
70+
cmd.Flags().UintVarP(
71+
cmdData.AllowedBackendStorageVolumeUsage,
72+
alias.ParamName,
73+
"",
74+
defaultVal,
75+
fmt.Sprintf("Set allowed percentage of backend (Docker or Buildah) storage volume usage which will cause cleanup of least recently used local backend images (default %d%% or $%s)", uint(host_cleaning.DefaultAllowedBackendStorageVolumeUsagePercentage), alias.EnvName),
76+
)
77+
}
6578

66-
var defaultVal uint
67-
if v := GetUint64EnvVarStrict(envVarName); v != nil {
68-
defaultVal = uint(*v)
69-
} else {
70-
defaultVal = uint(host_cleaning.DefaultAllowedDockerStorageVolumeUsageMarginPercentage)
79+
if err := cmd.Flags().MarkHidden(aliases[1].ParamName); err != nil {
80+
panic(err)
7181
}
82+
}
83+
84+
func SetupAllowedBackendStorageVolumeUsageMargin(cmdData *CmdData, cmd *cobra.Command) {
85+
aliases := []struct {
86+
ParamName string
87+
EnvName string
88+
}{
89+
{"allowed-backend-storage-volume-usage-margin", "WERF_ALLOWED_BACKEND_STORAGE_VOLUME_USAGE_MARGIN"},
90+
{"allowed-docker-storage-volume-usage-margin", "WERF_ALLOWED_DOCKER_STORAGE_VOLUME_USAGE_MARGIN"},
91+
}
92+
93+
defaultValUint64 := option.PtrValueOrDefault(GetUint64EnvVarStrict(aliases[0].EnvName),
94+
// keep backward compatibility
95+
option.PtrValueOrDefault(GetUint64EnvVarStrict(aliases[1].EnvName),
96+
uint64(host_cleaning.DefaultAllowedBackendStorageVolumeUsageMarginPercentage)))
97+
98+
defaultVal := uint(defaultValUint64)
99+
72100
if defaultVal > 100 {
73-
TerminateWithError(fmt.Sprintf("bad %s value: specify percentage between 0 and 100", envVarName), 1)
101+
TerminateWithError(fmt.Sprintf("bad %s value: specify percentage between 0 and 100", aliases[0].EnvName), 1)
102+
}
103+
104+
cmdData.AllowedBackendStorageVolumeUsageMargin = new(uint)
105+
106+
for _, alias := range aliases {
107+
cmd.Flags().UintVarP(
108+
cmdData.AllowedBackendStorageVolumeUsageMargin,
109+
alias.ParamName,
110+
"",
111+
defaultVal,
112+
fmt.Sprintf("During cleanup of least recently used local backend (Docker or Buildah) images werf would delete images until volume usage becomes below \"allowed-backend-storage-volume-usage - allowed-backend-storage-volume-usage-margin\" level (default %d%% or $%s)", uint(host_cleaning.DefaultAllowedBackendStorageVolumeUsageMarginPercentage), alias.EnvName),
113+
)
74114
}
75115

76-
cmdData.AllowedDockerStorageVolumeUsageMargin = new(uint)
77-
cmd.Flags().UintVarP(cmdData.AllowedDockerStorageVolumeUsageMargin, "allowed-docker-storage-volume-usage-margin", "", defaultVal, fmt.Sprintf("During cleanup of least recently used local docker images werf would delete images until volume usage becomes below \"allowed-docker-storage-volume-usage - allowed-docker-storage-volume-usage-margin\" level (default %d%% or $%s)", uint(host_cleaning.DefaultAllowedDockerStorageVolumeUsageMarginPercentage), envVarName))
116+
if err := cmd.Flags().MarkHidden(aliases[1].ParamName); err != nil {
117+
panic(err)
118+
}
78119
}
79120

80-
func SetupDockerServerStoragePath(cmdData *CmdData, cmd *cobra.Command) {
81-
cmdData.DockerServerStoragePath = new(string)
82-
cmd.Flags().StringVarP(cmdData.DockerServerStoragePath, "docker-server-storage-path", "", os.Getenv("WERF_DOCKER_SERVER_STORAGE_PATH"), "Use specified path to the local docker server storage to check docker storage volume usage while performing garbage collection of local docker images (detect local docker server storage path by default or use $WERF_DOCKER_SERVER_STORAGE_PATH)")
121+
func SetupBackendStoragePath(cmdData *CmdData, cmd *cobra.Command) {
122+
aliases := []struct {
123+
ParamName string
124+
EnvName string
125+
}{
126+
{"backend-storage-path", "WERF_BACKEND_STORAGE_PATH"},
127+
{"docker-server-storage-path", "WERF_DOCKER_SERVER_STORAGE_PATH"},
128+
}
129+
130+
defaultVal := option.ValueOrDefault(os.Getenv(aliases[0].EnvName),
131+
// keep backward compatibility
132+
os.Getenv(aliases[1].EnvName))
133+
134+
cmdData.BackendStoragePath = new(string)
135+
136+
for _, alias := range aliases {
137+
cmd.Flags().StringVarP(
138+
cmdData.BackendStoragePath,
139+
alias.ParamName,
140+
"",
141+
defaultVal,
142+
fmt.Sprintf("Use specified path to the local backend (Docker or Buildah) storage to check backend storage volume usage while performing garbage collection of local backend images (detect local backend storage path by default or use $%s)", alias.EnvName),
143+
)
144+
}
145+
146+
if err := cmd.Flags().MarkHidden(aliases[1].ParamName); err != nil {
147+
panic(err)
148+
}
83149
}
84150

85151
func SetupAllowedLocalCacheVolumeUsage(cmdData *CmdData, cmd *cobra.Command) {
@@ -113,5 +179,5 @@ func SetupAllowedLocalCacheVolumeUsageMargin(cmdData *CmdData, cmd *cobra.Comman
113179
}
114180

115181
cmdData.AllowedLocalCacheVolumeUsageMargin = new(uint)
116-
cmd.Flags().UintVarP(cmdData.AllowedLocalCacheVolumeUsageMargin, "allowed-local-cache-volume-usage-margin", "", defaultVal, fmt.Sprintf("During cleanup of least recently used local docker images werf would delete images until volume usage becomes below \"allowed-docker-storage-volume-usage - allowed-docker-storage-volume-usage-margin\" level (default %d%% or $%s)", uint(host_cleaning.DefaultAllowedLocalCacheVolumeUsageMarginPercentage), envVarName))
182+
cmd.Flags().UintVarP(cmdData.AllowedLocalCacheVolumeUsageMargin, "allowed-local-cache-volume-usage-margin", "", defaultVal, fmt.Sprintf("During cleanup of local cache werf would delete local cache data until volume usage becomes below \"allowed-local-cache-volume-usage - allowed-local-cache-volume-usage-margin\" level (default %d%% or $%s)", uint(host_cleaning.DefaultAllowedLocalCacheVolumeUsageMarginPercentage), envVarName))
117183
}

cmd/werf/compose/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ func newCmd(ctx context.Context, composeCmdName string, options *newCmdOptions)
322322
common.SetupVirtualMerge(&commonCmdData, cmd)
323323

324324
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
325-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
326-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
325+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
326+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
327327
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
328328
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
329-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
329+
common.SetupBackendStoragePath(&commonCmdData, cmd)
330330

331331
commonCmdData.SetupPlatform(cmd)
332332

cmd/werf/converge/converge.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ werf converge --repo registry.mydomain.com/web --env production`,
168168
common.SetupFollow(&commonCmdData, cmd)
169169

170170
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
171-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
172-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
171+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
172+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
173173
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
174174
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
175-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
175+
common.SetupBackendStoragePath(&commonCmdData, cmd)
176176

177177
common.SetupNetworkParallelism(&commonCmdData, cmd)
178178
common.SetupKubeQpsLimit(&commonCmdData, cmd)

cmd/werf/dismiss/dismiss.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ func NewCmd(ctx context.Context) *cobra.Command {
113113
common.SetupLogProjectDir(&commonCmdData, cmd)
114114

115115
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
116-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
117-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
116+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
117+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
118118
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
119119
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
120-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
120+
common.SetupBackendStoragePath(&commonCmdData, cmd)
121121

122122
common.SetupInsecureRegistry(&commonCmdData, cmd)
123123
common.SetupInsecureHelmDependencies(&commonCmdData, cmd, true)

cmd/werf/host/cleanup/cleanup.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ func NewCmd(ctx context.Context) *cobra.Command {
6262
common.SetupDryRun(&commonCmdData, cmd)
6363

6464
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
65-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
66-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
65+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
66+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
6767
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
6868
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
69-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
69+
common.SetupBackendStoragePath(&commonCmdData, cmd)
7070
commonCmdData.SetupPlatform(cmd)
7171
common.SetupInsecureRegistry(&commonCmdData, cmd)
7272
common.SetupSkipTlsVerifyRegistry(&commonCmdData, cmd)
@@ -102,11 +102,11 @@ func runCleanup(ctx context.Context) error {
102102
hostCleanupOptions := host_cleaning.HostCleanupOptions{
103103
DryRun: *commonCmdData.DryRun,
104104
Force: cmdData.Force,
105-
AllowedDockerStorageVolumeUsagePercentage: commonCmdData.AllowedDockerStorageVolumeUsage,
106-
AllowedDockerStorageVolumeUsageMarginPercentage: commonCmdData.AllowedDockerStorageVolumeUsageMargin,
107-
AllowedLocalCacheVolumeUsagePercentage: commonCmdData.AllowedLocalCacheVolumeUsage,
108-
AllowedLocalCacheVolumeUsageMarginPercentage: commonCmdData.AllowedLocalCacheVolumeUsageMargin,
109-
DockerServerStoragePath: commonCmdData.DockerServerStoragePath,
105+
AllowedBackendStorageVolumeUsagePercentage: commonCmdData.AllowedBackendStorageVolumeUsage,
106+
AllowedBackendStorageVolumeUsageMarginPercentage: commonCmdData.AllowedBackendStorageVolumeUsageMargin,
107+
AllowedLocalCacheVolumeUsagePercentage: commonCmdData.AllowedLocalCacheVolumeUsage,
108+
AllowedLocalCacheVolumeUsageMarginPercentage: commonCmdData.AllowedLocalCacheVolumeUsageMargin,
109+
BackendStoragePath: commonCmdData.BackendStoragePath,
110110
}
111111

112112
return host_cleaning.RunHostCleanup(ctx, commonManager.ContainerBackend(), hostCleanupOptions)

cmd/werf/plan/plan.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ werf plan --repo registry.mydomain.com/web --env production`,
167167
common.SetupFollow(&commonCmdData, cmd)
168168

169169
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
170-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
171-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
170+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
171+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
172172
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
173173
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
174-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
174+
common.SetupBackendStoragePath(&commonCmdData, cmd)
175175

176176
common.SetupNetworkParallelism(&commonCmdData, cmd)
177177
common.SetupKubeQpsLimit(&commonCmdData, cmd)

cmd/werf/purge/purge.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ func NewCmd(ctx context.Context) *cobra.Command {
7373
common.SetupKubeContext(&commonCmdData, cmd)
7474

7575
common.SetupDisableAutoHostCleanup(&commonCmdData, cmd)
76-
common.SetupAllowedDockerStorageVolumeUsage(&commonCmdData, cmd)
77-
common.SetupAllowedDockerStorageVolumeUsageMargin(&commonCmdData, cmd)
76+
common.SetupAllowedBackendStorageVolumeUsage(&commonCmdData, cmd)
77+
common.SetupAllowedBackendStorageVolumeUsageMargin(&commonCmdData, cmd)
7878
common.SetupAllowedLocalCacheVolumeUsage(&commonCmdData, cmd)
7979
common.SetupAllowedLocalCacheVolumeUsageMargin(&commonCmdData, cmd)
80-
common.SetupDockerServerStoragePath(&commonCmdData, cmd)
80+
common.SetupBackendStoragePath(&commonCmdData, cmd)
8181

8282
common.SetupDryRun(&commonCmdData, cmd)
8383

0 commit comments

Comments
 (0)