Disallow writeback caching with cache_after (#11002)

fixes #10974
master
Poorna Krishnamoorthy 4 years ago committed by GitHub
parent ae4ded7fd1
commit 2f564437ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/config/cache/lookup.go
  2. 5
      cmd/config/errors.go

@ -222,6 +222,10 @@ func LookupConfig(kvs config.KVS) (Config, error) {
if err != nil { if err != nil {
return cfg, err return cfg, err
} }
if cfg.After > 0 && cfg.CommitWriteback {
err := errors.New("cache after cannot be used with commit writeback")
return cfg, config.ErrInvalidCacheSetting(err)
}
} }
return cfg, nil return cfg, nil

@ -108,6 +108,11 @@ var (
"MINIO_CACHE_COMMIT: Valid expected value is `writeback` or `writethrough`", "MINIO_CACHE_COMMIT: Valid expected value is `writeback` or `writethrough`",
) )
ErrInvalidCacheSetting = newErrFn(
"Incompatible cache setting",
"Please check the passed value",
"MINIO_CACHE_AFTER cannot be used with MINIO_CACHE_COMMIT setting",
)
ErrInvalidRotatingCredentialsBackendEncrypted = newErrFn( ErrInvalidRotatingCredentialsBackendEncrypted = newErrFn(
"Invalid rotating credentials", "Invalid rotating credentials",
"Please set correct rotating credentials in the environment for decryption", "Please set correct rotating credentials in the environment for decryption",

Loading…
Cancel
Save