rename zones to serverSets to avoid terminology conflict (#10679)
we are bringing in availability zones, we should avoid zones as per server expansion concept.
This commit is contained in:
@@ -286,7 +286,7 @@ func isSameType(obj1, obj2 interface{}) bool {
|
||||
// defer s.Stop()
|
||||
type TestServer struct {
|
||||
Root string
|
||||
Disks EndpointZones
|
||||
Disks EndpointServerSets
|
||||
AccessKey string
|
||||
SecretKey string
|
||||
Server *httptest.Server
|
||||
@@ -403,7 +403,7 @@ func resetGlobalConfig() {
|
||||
}
|
||||
|
||||
func resetGlobalEndpoints() {
|
||||
globalEndpoints = EndpointZones{}
|
||||
globalEndpoints = EndpointServerSets{}
|
||||
}
|
||||
|
||||
func resetGlobalIsErasure() {
|
||||
@@ -1546,14 +1546,14 @@ func getRandomDisks(N int) ([]string, error) {
|
||||
}
|
||||
|
||||
// Initialize object layer with the supplied disks, objectLayer is nil upon any error.
|
||||
func newTestObjectLayer(ctx context.Context, endpointZones EndpointZones) (newObject ObjectLayer, err error) {
|
||||
func newTestObjectLayer(ctx context.Context, endpointServerSets EndpointServerSets) (newObject ObjectLayer, err error) {
|
||||
// For FS only, directly use the disk.
|
||||
if endpointZones.NEndpoints() == 1 {
|
||||
if endpointServerSets.NEndpoints() == 1 {
|
||||
// Initialize new FS object layer.
|
||||
return NewFSObjectLayer(endpointZones[0].Endpoints[0].Path)
|
||||
return NewFSObjectLayer(endpointServerSets[0].Endpoints[0].Path)
|
||||
}
|
||||
|
||||
z, err := newErasureZones(ctx, endpointZones)
|
||||
z, err := newErasureServerSets(ctx, endpointServerSets)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1566,16 +1566,16 @@ func newTestObjectLayer(ctx context.Context, endpointZones EndpointZones) (newOb
|
||||
}
|
||||
|
||||
// initObjectLayer - Instantiates object layer and returns it.
|
||||
func initObjectLayer(ctx context.Context, endpointZones EndpointZones) (ObjectLayer, []StorageAPI, error) {
|
||||
objLayer, err := newTestObjectLayer(ctx, endpointZones)
|
||||
func initObjectLayer(ctx context.Context, endpointServerSets EndpointServerSets) (ObjectLayer, []StorageAPI, error) {
|
||||
objLayer, err := newTestObjectLayer(ctx, endpointServerSets)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var formattedDisks []StorageAPI
|
||||
// Should use the object layer tests for validating cache.
|
||||
if z, ok := objLayer.(*erasureZones); ok {
|
||||
formattedDisks = z.zones[0].GetDisks(0)()
|
||||
if z, ok := objLayer.(*erasureServerSets); ok {
|
||||
formattedDisks = z.serverSets[0].GetDisks(0)()
|
||||
}
|
||||
|
||||
// Success.
|
||||
@@ -2212,7 +2212,7 @@ func generateTLSCertKey(host string) ([]byte, []byte, error) {
|
||||
return certOut.Bytes(), keyOut.Bytes(), nil
|
||||
}
|
||||
|
||||
func mustGetZoneEndpoints(args ...string) EndpointZones {
|
||||
func mustGetZoneEndpoints(args ...string) EndpointServerSets {
|
||||
endpoints := mustGetNewEndpoints(args...)
|
||||
return []ZoneEndpoints{{
|
||||
SetCount: 1,
|
||||
@@ -2227,8 +2227,8 @@ func mustGetNewEndpoints(args ...string) (endpoints Endpoints) {
|
||||
return endpoints
|
||||
}
|
||||
|
||||
func getEndpointsLocalAddr(endpointZones EndpointZones) string {
|
||||
for _, endpoints := range endpointZones {
|
||||
func getEndpointsLocalAddr(endpointServerSets EndpointServerSets) string {
|
||||
for _, endpoints := range endpointServerSets {
|
||||
for _, endpoint := range endpoints.Endpoints {
|
||||
if endpoint.IsLocal && endpoint.Type() == URLEndpointType {
|
||||
return endpoint.Host
|
||||
|
||||
Reference in New Issue
Block a user