storage: remove *REGIONAL from StorageClass
MULTI_REGIONAL, DURABLE_REDUCED_AVAILABILITY and
REGIONAL are no longer StorageClasses but they are
still LocationTypes.
Fixes #1570.
Change-Id: I26a741aa99352b8fb9734f9d4464e7a47547a247
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/45230
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jean de Klerk <deklerk@google.com>
Reviewed-by: Jesse Lovelace <jesselovelace@google.com>
diff --git a/storage/bucket.go b/storage/bucket.go
index 07c470d..0ba45e8 100644
--- a/storage/bucket.go
+++ b/storage/bucket.go
@@ -267,14 +267,8 @@
// StorageClass is the default storage class of the bucket. This defines
// how objects in the bucket are stored and determines the SLA
- // and the cost of storage. Typical values are "MULTI_REGIONAL",
- // "REGIONAL", "NEARLINE", "COLDLINE", "STANDARD" and
- // "DURABLE_REDUCED_AVAILABILITY". Defaults to "STANDARD", which
- // is equivalent to "MULTI_REGIONAL" or "REGIONAL" depending on
- // the bucket's location settings.
- //
- // "DURABLE_REDUCED_AVAILABILITY", "MULTI_REGIONAL" and "REGIONAL"
- // are considered legacy storage classes.
+ // and the cost of storage. Typical values are "NEARLINE", "COLDLINE" and
+ // "STANDARD". Defaults to "STANDARD".
StorageClass string
// Created is the creation time of the bucket.
@@ -446,8 +440,7 @@
// MatchesStorageClasses is the condition matching the object's storage
// class.
//
- // Values include "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE",
- // "STANDARD", and "DURABLE_REDUCED_AVAILABILITY".
+ // Values include "NEARLINE", "COLDLINE" and "STANDARD".
MatchesStorageClasses []string
// NumNewerVersions is the condition matching objects with a number of newer versions.
diff --git a/storage/bucket_test.go b/storage/bucket_test.go
index 61a186e..8fbb08a 100644
--- a/storage/bucket_test.go
+++ b/storage/bucket_test.go
@@ -66,7 +66,7 @@
AgeInDays: 10,
Liveness: Live,
CreatedBefore: time.Date(2017, 1, 2, 3, 4, 5, 6, time.UTC),
- MatchesStorageClasses: []string{"MULTI_REGIONAL", "REGIONAL", "STANDARD"},
+ MatchesStorageClasses: []string{"STANDARD"},
NumNewerVersions: 3,
},
}, {
@@ -132,7 +132,7 @@
Age: 10,
IsLive: googleapi.Bool(true),
CreatedBefore: "2017-01-02",
- MatchesStorageClass: []string{"MULTI_REGIONAL", "REGIONAL", "STANDARD"},
+ MatchesStorageClass: []string{"STANDARD"},
NumNewerVersions: 3,
},
}, {
@@ -354,7 +354,7 @@
func TestNewBucket(t *testing.T) {
labels := map[string]string{"a": "b"}
- matchClasses := []string{"MULTI_REGIONAL", "REGIONAL", "STANDARD"}
+ matchClasses := []string{"STANDARD"}
aTime := time.Date(2017, 1, 2, 0, 0, 0, 0, time.UTC)
rb := &raw.Bucket{
Name: "name",
diff --git a/storage/integration_test.go b/storage/integration_test.go
index 01229e5..d43f9be 100644
--- a/storage/integration_test.go
+++ b/storage/integration_test.go
@@ -254,7 +254,7 @@
AgeInDays: 10,
Liveness: Archived,
CreatedBefore: time.Date(2017, 1, 1, 0, 0, 0, 0, time.UTC),
- MatchesStorageClasses: []string{"MULTI_REGIONAL", "STANDARD"},
+ MatchesStorageClasses: []string{"STANDARD"},
NumNewerVersions: 3,
},
}, {
@@ -1559,7 +1559,7 @@
func TestIntegration_PerObjectStorageClass(t *testing.T) {
const (
defaultStorageClass = "STANDARD"
- newStorageClass = "MULTI_REGIONAL"
+ newStorageClass = "NEARLINE"
)
ctx := context.Background()
client := testConfig(ctx, t)
diff --git a/storage/storage.go b/storage/storage.go
index d35bd75..1ffb10f 100644
--- a/storage/storage.go
+++ b/storage/storage.go
@@ -992,10 +992,8 @@
// StorageClass is the storage class of the object.
// This value defines how objects in the bucket are stored and
// determines the SLA and the cost of storage. Typical values are
- // "MULTI_REGIONAL", "REGIONAL", "NEARLINE", "COLDLINE", "STANDARD"
- // and "DURABLE_REDUCED_AVAILABILITY".
- // It defaults to "STANDARD", which is equivalent to "MULTI_REGIONAL"
- // or "REGIONAL" depending on the bucket's location settings.
+ // "NEARLINE", "COLDLINE" and "STANDARD".
+ // It defaults to "STANDARD".
StorageClass string
// Created is the time the object was created. This field is read-only.