Skip to content

Commit 58c42bc

Browse files
authored
Allow STANDARD_IA as a AWS tier storage class (#4994)
1 parent f6df01d commit 58c42bc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/ilm-tier-add.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package cmd
2020
import (
2121
"fmt"
2222
"os"
23+
"slices"
2324
"strings"
2425

2526
"github.com/fatih/color"
@@ -169,10 +170,8 @@ func checkAdminTierAddSyntax(ctx *cli.Context) {
169170
}
170171
}
171172

172-
const (
173-
s3Standard = "STANDARD"
174-
s3ReducedRedundancy = "REDUCED_REDUNDANCY"
175-
)
173+
// The list of AWS S3 storage classes that can be used with MinIO ILM tiering
174+
var supportedAWSTierSC = []string{"STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA"}
176175

177176
// fetchTierConfig returns a TierConfig given a tierName, a tierType and ctx to
178177
// lookup command-line flags from. It exits with non-zero error code if any of
@@ -256,7 +255,7 @@ func fetchTierConfig(ctx *cli.Context, tierName string, tierType madmin.TierType
256255

257256
s3SC := ctx.String("storage-class")
258257
if s3SC != "" {
259-
if s3SC != s3Standard && s3SC != s3ReducedRedundancy {
258+
if !slices.Contains(supportedAWSTierSC, s3SC) {
260259
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("unsupported storage-class type %s", s3SC))
261260
}
262261
s3Opts = append(s3Opts, madmin.S3StorageClass(s3SC))

0 commit comments

Comments
 (0)