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"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: PRUNE_ENABLED
|
||||
value: "{{.Values.storagesvc.archivePruner.enabled}}"
|
||||
{{- if .Values.storagesvc.archivePruner.enabled }}
|
||||
- name: PRUNE_INTERVAL
|
||||
value: "{{.Values.pruneInterval}}"
|
||||
value: "{{.Values.storagesvc.archivePruner.interval}}"
|
||||
{{- end }}
|
||||
- name: DEBUG_ENV
|
||||
value: {{ .Values.debugEnv | quote }}
|
||||
- name: PPROF_ENABLED
|
||||
|
||||
@@ -365,6 +365,12 @@ storagesvc:
|
||||
##
|
||||
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
|
||||
## It holds pod-level and container level security configuration.
|
||||
## 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.
|
||||
## The value is in minutes.
|
||||
##
|
||||
pruneInterval: 60
|
||||
|
||||
preUpgradeChecks:
|
||||
## 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
|
||||
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
|
||||
storageClient, err := MakeStowClient(logger, storage)
|
||||
if err != nil {
|
||||
|
||||
+3
-2
@@ -45,7 +45,8 @@ deploy:
|
||||
pprof.enabled: false
|
||||
canaryDeployment.enabled: false
|
||||
influxdb.enabled: false
|
||||
pruneInterval: "60"
|
||||
storagesvc.archivePruner.enabled: true
|
||||
storagesvc.archivePruner.interval: "60"
|
||||
repository: index.docker.io
|
||||
routerServiceType: LoadBalancer
|
||||
openTracing.enabled: false
|
||||
@@ -102,7 +103,7 @@ profiles:
|
||||
path: /deploy/helm/releases/0/setValues/repository
|
||||
value: ""
|
||||
- op: replace
|
||||
path: /deploy/helm/releases/0/setValues/pruneInterval
|
||||
path: /deploy/helm/releases/0/setValues/storagesvc.archivePruner.interval
|
||||
value: 1
|
||||
- op: replace
|
||||
path: /deploy/helm/releases/0/setValues/routerServiceType
|
||||
|
||||
Reference in New Issue
Block a user