Add functionality to add old buckets to etcd on startup

Buckets already present on a Minio server before it joins a
bucket federated deployment will now be added to etcd during
startup. In case of a bucket name collision, admin is informed
via Minio server console message.

Added configuration migration for configuration stored in etcd
backend.

Also, environment variables are updated and ListBucket path style
request is no longer forwarded.
This commit is contained in:
Nitish
2018-04-05 20:48:42 +05:30
committed by kannappanr
parent 853ea371ce
commit 6df1e4a529
11 changed files with 188 additions and 83 deletions

View File

@@ -127,10 +127,28 @@ func (s *serverConfig) GetCacheConfig() CacheConfig {
return s.Cache
}
// Save config.
func (s *serverConfig) Save(configFile string) error {
// Save config file.
return quick.Save(configFile, s)
// Save config file to corresponding backend
func Save(configFile string, data interface{}) error {
if globalEtcdClient == nil {
return quick.SaveLocalConfig(configFile, data)
}
return quick.SaveEtcdConfig(configFile, data, globalEtcdClient)
}
// Load config from backend
func Load(configFile string, data interface{}) (quick.Config, error) {
if globalEtcdClient == nil {
return quick.LoadLocalConfig(configFile, data)
}
return quick.LoadEtcdConfig(configFile, data, globalEtcdClient)
}
// GetVersion gets config version from backend
func GetVersion(configFile string) (string, error) {
if globalEtcdClient == nil {
return quick.GetLocalVersion(configFile)
}
return quick.GetEtcdVersion(configFile, globalEtcdClient)
}
// Returns the string describing a difference with the given
@@ -272,7 +290,7 @@ func newConfig() error {
globalServerConfigMu.Unlock()
// Save config into file.
return globalServerConfig.Save(getConfigFile())
return Save(getConfigFile(), globalServerConfig)
}
// newQuickConfig - initialize a new server config, with an allocated