mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 08:38:03 +01:00
Merge pull request #9657 from wy65701436/quota-sync-switcher
add a switcher for quota sync on core launch
This commit is contained in:
commit
bc65609a10
@ -2,6 +2,7 @@ CONFIG_PATH=/etc/core/app.conf
|
||||
UAA_CA_ROOT=/etc/core/certificates/uaa_ca.pem
|
||||
_REDIS_URL={{redis_host}}:{{redis_port}},100,{{redis_password}}
|
||||
SYNC_REGISTRY=false
|
||||
SYNC_QUOTA=true
|
||||
CHART_CACHE_DRIVER={{chart_cache_driver}}
|
||||
_REDIS_URL_REG={{redis_url_reg}}
|
||||
|
||||
|
@ -272,8 +272,18 @@ func main() {
|
||||
log.Fatalf("init proxy error, %v", err)
|
||||
}
|
||||
|
||||
if err := quotaSync(); err != nil {
|
||||
log.Fatalf("quota migration error, %v", err)
|
||||
syncQuota := os.Getenv("SYNC_QUOTA")
|
||||
doSyncQuota, err := strconv.ParseBool(syncQuota)
|
||||
if err != nil {
|
||||
log.Errorf("Failed to parse SYNC_QUOTA: %v", err)
|
||||
doSyncQuota = true
|
||||
}
|
||||
if doSyncQuota {
|
||||
if err := quotaSync(); err != nil {
|
||||
log.Fatalf("quota migration error, %v", err)
|
||||
}
|
||||
} else {
|
||||
log.Infof("Because SYNC_QUOTA set false , no need to sync quota \n")
|
||||
}
|
||||
|
||||
log.Infof("Version: %s, Git commit: %s", version.ReleaseVersion, version.GitCommit)
|
||||
|
Loading…
Reference in New Issue
Block a user