formatMetaV1 should be "inherited" by disk format structs (#6134)

master
Krishna Srinivas 6 years ago committed by Harshavardhana
parent 289d6ce1d7
commit 0c9f4c9092
  1. 8
      cmd/format-xl.go
  2. 6
      cmd/format-xl_test.go

@ -86,9 +86,10 @@ type formatXLV1 struct {
// Represents the V2 backend disk structure version // Represents the V2 backend disk structure version
// under `.minio.sys` and actual data namespace. // under `.minio.sys` and actual data namespace.
// formatXLV2 - structure holds format config version '2'. // formatXLV2 - structure holds format config version '2'.
// The V2 format to support "large bucket" support where a bucket
// can span multiple erasure sets.
type formatXLV2 struct { type formatXLV2 struct {
Version string `json:"version"` formatMetaV1
Format string `json:"format"`
XL struct { XL struct {
Version string `json:"version"` // Version of 'xl' format. Version string `json:"version"` // Version of 'xl' format.
This string `json:"this"` // This field carries assigned disk uuid. This string `json:"this"` // This field carries assigned disk uuid.
@ -107,8 +108,7 @@ type formatXLV2 struct {
// In .minio.sys/multipart we have: // In .minio.sys/multipart we have:
// sha256(bucket/object)/uploadID/[xl.json, part.1, part.2 ....] // sha256(bucket/object)/uploadID/[xl.json, part.1, part.2 ....]
type formatXLV3 struct { type formatXLV3 struct {
Version string `json:"version"` formatMetaV1
Format string `json:"format"`
XL struct { XL struct {
Version string `json:"version"` // Version of 'xl' format. Version string `json:"version"` // Version of 'xl' format.
This string `json:"this"` // This field carries assigned disk uuid. This string `json:"this"` // This field carries assigned disk uuid.

@ -345,8 +345,10 @@ func TestCheckFormatXLValue(t *testing.T) {
// Invalid XL format version "2". // Invalid XL format version "2".
{ {
&formatXLV3{ &formatXLV3{
formatMetaV1: formatMetaV1{
Version: "2", Version: "2",
Format: "XL", Format: "XL",
},
XL: struct { XL: struct {
Version string `json:"version"` Version string `json:"version"`
This string `json:"this"` This string `json:"this"`
@ -361,8 +363,10 @@ func TestCheckFormatXLValue(t *testing.T) {
// Invalid XL format "Unknown". // Invalid XL format "Unknown".
{ {
&formatXLV3{ &formatXLV3{
formatMetaV1: formatMetaV1{
Version: "1", Version: "1",
Format: "Unknown", Format: "Unknown",
},
XL: struct { XL: struct {
Version string `json:"version"` Version string `json:"version"`
This string `json:"this"` This string `json:"this"`
@ -377,8 +381,10 @@ func TestCheckFormatXLValue(t *testing.T) {
// Invalid XL format version "0". // Invalid XL format version "0".
{ {
&formatXLV3{ &formatXLV3{
formatMetaV1: formatMetaV1{
Version: "1", Version: "1",
Format: "XL", Format: "XL",
},
XL: struct { XL: struct {
Version string `json:"version"` Version string `json:"version"`
This string `json:"this"` This string `json:"this"`

Loading…
Cancel
Save