mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 20:38:08 +08:00
gc: add a gcDelay param
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
35eeedb22a
commit
38a110314b
@@ -221,6 +221,18 @@ func NewCliRootCmd() *cobra.Command {
|
||||
}
|
||||
|
||||
func validateConfiguration(config *config.Config) {
|
||||
// enforce GC params
|
||||
if config.Storage.GCDelay < 0 {
|
||||
log.Error().Err(errors.ErrBadConfig).
|
||||
Msgf("invalid garbage-collect delay %v specified", config.Storage.GCDelay)
|
||||
panic(errors.ErrBadConfig)
|
||||
}
|
||||
|
||||
if !config.Storage.GC && config.Storage.GCDelay != 0 {
|
||||
log.Warn().Err(errors.ErrBadConfig).
|
||||
Msg("garbage-collect delay specified without enabling garbage-collect, will be ignored")
|
||||
}
|
||||
|
||||
// check authorization config, it should have basic auth enabled or ldap
|
||||
if config.HTTP.RawAccessControl != nil {
|
||||
if config.HTTP.Auth == nil || (config.HTTP.Auth.HTPasswd.Path == "" && config.HTTP.Auth.LDAP == nil) {
|
||||
|
||||
Reference in New Issue
Block a user