Add Veeam storage class override (#19748)

Recent Veeam is very picky about storage class names. Add `_MINIO_VEEAM_FORCE_SC` env var.

It will override the storage class returned by the storage backend if it is non-standard
and we detect a Veeam client by checking the User Agent.

Applies to HeadObject/GetObject/ListObject*
This commit is contained in:
Klaus Post
2024-05-15 11:04:16 -07:00
committed by GitHub
parent d3db7d31a3
commit b792b36495
8 changed files with 42 additions and 18 deletions

View File

@@ -47,6 +47,7 @@ import (
"github.com/minio/minio/internal/config"
"github.com/minio/minio/internal/config/api"
xtls "github.com/minio/minio/internal/config/identity/tls"
"github.com/minio/minio/internal/config/storageclass"
"github.com/minio/minio/internal/fips"
"github.com/minio/minio/internal/handlers"
"github.com/minio/minio/internal/hash"
@@ -1142,3 +1143,11 @@ type itemOrErr[V any] struct {
Item V
Err error
}
func filterStorageClass(ctx context.Context, s string) string {
// Veeam 14.0 and later clients are not compatible with custom storage classes.
if globalVeeamForceSC != "" && s != storageclass.STANDARD && s != storageclass.RRS && isVeeamClient(ctx) {
return globalVeeamForceSC
}
return s
}