Added variable to enable or disable archivePruner (#2458)
* Added variable to enable or disable archivePruner * Made fixes according to code review comments * Minor changes
This commit is contained in:
@@ -36,8 +36,12 @@ spec:
|
|||||||
args: ["--storageServicePort", "8000", "--storageType", "local"]
|
args: ["--storageServicePort", "8000", "--storageType", "local"]
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
|
- name: PRUNE_ENABLED
|
||||||
|
value: "{{.Values.storagesvc.archivePruner.enabled}}"
|
||||||
|
{{- if .Values.storagesvc.archivePruner.enabled }}
|
||||||
- name: PRUNE_INTERVAL
|
- name: PRUNE_INTERVAL
|
||||||
value: "{{.Values.pruneInterval}}"
|
value: "{{.Values.storagesvc.archivePruner.interval}}"
|
||||||
|
{{- end }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
|
|||||||
@@ -365,6 +365,12 @@ storagesvc:
|
|||||||
##
|
##
|
||||||
resources: {}
|
resources: {}
|
||||||
|
|
||||||
|
## Archive pruner removes archives from storage which are not referenced by any package.
|
||||||
|
archivePruner:
|
||||||
|
enabled: true
|
||||||
|
## Run prune routine at interval (in minutes)
|
||||||
|
interval: 60
|
||||||
|
|
||||||
## Security Context
|
## Security Context
|
||||||
## It holds pod-level and container level security configuration.
|
## It holds pod-level and container level security configuration.
|
||||||
## This is an experimental section, please verify before enabling in production.
|
## This is an experimental section, please verify before enabling in production.
|
||||||
@@ -567,7 +573,6 @@ busyboxImage: busybox
|
|||||||
## This interval configures the frequency at which it runs inside the storagesvc pod.
|
## This interval configures the frequency at which it runs inside the storagesvc pod.
|
||||||
## The value is in minutes.
|
## The value is in minutes.
|
||||||
##
|
##
|
||||||
pruneInterval: 60
|
|
||||||
|
|
||||||
preUpgradeChecks:
|
preUpgradeChecks:
|
||||||
## Run pre-install/pre-upgrade checks if true
|
## Run pre-install/pre-upgrade checks if true
|
||||||
|
|||||||
@@ -236,7 +236,11 @@ func (ss *StorageService) Start(ctx context.Context, port int, openTracingEnable
|
|||||||
|
|
||||||
// Start runs storage service
|
// Start runs storage service
|
||||||
func Start(ctx context.Context, logger *zap.Logger, storage Storage, port int, openTracingEnabled bool) error {
|
func Start(ctx context.Context, logger *zap.Logger, storage Storage, port int, openTracingEnabled bool) error {
|
||||||
enablePruner := true
|
enablePruner, err := strconv.ParseBool(os.Getenv("PRUNE_ENABLED"))
|
||||||
|
if err != nil {
|
||||||
|
logger.Warn("PRUNE_ENABLED value not set. Enabling archive pruner by default.", zap.Error(err))
|
||||||
|
enablePruner = true
|
||||||
|
}
|
||||||
// create a storage client
|
// create a storage client
|
||||||
storageClient, err := MakeStowClient(logger, storage)
|
storageClient, err := MakeStowClient(logger, storage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+3
-2
@@ -45,7 +45,8 @@ deploy:
|
|||||||
pprof.enabled: false
|
pprof.enabled: false
|
||||||
canaryDeployment.enabled: false
|
canaryDeployment.enabled: false
|
||||||
influxdb.enabled: false
|
influxdb.enabled: false
|
||||||
pruneInterval: "60"
|
storagesvc.archivePruner.enabled: true
|
||||||
|
storagesvc.archivePruner.interval: "60"
|
||||||
repository: index.docker.io
|
repository: index.docker.io
|
||||||
routerServiceType: LoadBalancer
|
routerServiceType: LoadBalancer
|
||||||
openTracing.enabled: false
|
openTracing.enabled: false
|
||||||
@@ -102,7 +103,7 @@ profiles:
|
|||||||
path: /deploy/helm/releases/0/setValues/repository
|
path: /deploy/helm/releases/0/setValues/repository
|
||||||
value: ""
|
value: ""
|
||||||
- op: replace
|
- op: replace
|
||||||
path: /deploy/helm/releases/0/setValues/pruneInterval
|
path: /deploy/helm/releases/0/setValues/storagesvc.archivePruner.interval
|
||||||
value: 1
|
value: 1
|
||||||
- op: replace
|
- op: replace
|
||||||
path: /deploy/helm/releases/0/setValues/routerServiceType
|
path: /deploy/helm/releases/0/setValues/routerServiceType
|
||||||
|
|||||||
Reference in New Issue
Block a user