Skip to content

Commit

Permalink
Allow STANDARD_IA as a AWS tier storage class (#4994)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadmeste authored Jul 22, 2024
1 parent f6df01d commit 58c42bc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/ilm-tier-add.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package cmd
import (
"fmt"
"os"
"slices"
"strings"

"github.com/fatih/color"
Expand Down Expand Up @@ -169,10 +170,8 @@ func checkAdminTierAddSyntax(ctx *cli.Context) {
}
}

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

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

s3SC := ctx.String("storage-class")
if s3SC != "" {
if s3SC != s3Standard && s3SC != s3ReducedRedundancy {
if !slices.Contains(supportedAWSTierSC, s3SC) {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("unsupported storage-class type %s", s3SC))
}
s3Opts = append(s3Opts, madmin.S3StorageClass(s3SC))
Expand Down

0 comments on commit 58c42bc

Please sign in to comment.