Skip to content

Commit

Permalink
Merge pull request #4 from traPtitech/fix-storage-class
Browse files Browse the repository at this point in the history
🐛 ストレージクラスがテスト用のSTANDARDのままだったので修正
  • Loading branch information
Kentaro1043 authored Dec 4, 2024
2 parents 02a4719 + a8bd509 commit de5fe37
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func main() {
// バケットが存在しない場合は作成
if err == storage.ErrBucketNotExist {
gcsNewBucketAttr := storage.BucketAttrs{
StorageClass: "STANDARD",
StorageClass: "COLDLINE",
Location: gcpConfig.Region,
VersioningEnabled: true,
// 90日でデータ削除
Expand All @@ -133,7 +133,7 @@ func main() {
log.Fatalf("Error: Failed to get GCS bucket attributes: %v", err)
} else {
// 既に存在している場合、バケットの状態を確認
if gcsBucketAttr.StorageClass != "STANDARD" {
if gcsBucketAttr.StorageClass != "COLDLINE" {
log.Fatalf("Error: Bucket storage class is not COLDLINE: %v", gcsBucketAttr.StorageClass)
}
if !gcsBucketAttr.VersioningEnabled {
Expand Down Expand Up @@ -236,7 +236,6 @@ func main() {
// メタデータ書き込み
if s3ObjectOutput.ContentType != nil {
gcsObjectWriter.ContentType = *s3ObjectOutput.ContentType
fmt.Println(*s3ObjectOutput.ContentType)
}
if s3ObjectOutput.ContentEncoding != nil {
gcsObjectWriter.ContentEncoding = *s3ObjectOutput.ContentEncoding
Expand Down

0 comments on commit de5fe37

Please sign in to comment.