Disable restarting server after setting a new config (#6521)

Also disable listening to service restart event in tests since
we don't do this anymore.
master
Anis Elleuch 6 years ago committed by Harshavardhana
parent 8c29f69b00
commit 83d7ec09c1
  1. 4
      cmd/admin-handlers.go
  2. 13
      cmd/admin-handlers_test.go
  3. 5
      pkg/madmin/config-commands.go

@ -787,8 +787,6 @@ func (a adminAPIHandlers) SetConfigHandler(w http.ResponseWriter, r *http.Reques
// Reply to the client before restarting minio server. // Reply to the client before restarting minio server.
writeSuccessResponseHeadersOnly(w) writeSuccessResponseHeadersOnly(w)
sendServiceCmd(globalAdminPeers, serviceRestart)
} }
func convertValueType(elem []byte, jsonType gjson.Type) (interface{}, error) { func convertValueType(elem []byte, jsonType gjson.Type) (interface{}, error) {
@ -920,8 +918,6 @@ func (a adminAPIHandlers) SetConfigKeysHandler(w http.ResponseWriter, r *http.Re
// Send success response // Send success response
writeSuccessResponseHeadersOnly(w) writeSuccessResponseHeadersOnly(w)
sendServiceCmd(globalAdminPeers, serviceRestart)
} }
// UpdateCredsHandler - POST /minio/admin/v1/config/credential // UpdateCredsHandler - POST /minio/admin/v1/config/credential

@ -713,16 +713,6 @@ func TestSetConfigHandler(t *testing.T) {
globalMinioAddr = "127.0.0.1:9000" globalMinioAddr = "127.0.0.1:9000"
initGlobalAdminPeers(mustGetNewEndpointList("http://127.0.0.1:9000/d1")) initGlobalAdminPeers(mustGetNewEndpointList("http://127.0.0.1:9000/d1"))
var wg sync.WaitGroup
// SetConfigHandler restarts minio setup - need to start a
// signal receiver to receive on globalServiceSignalCh.
wg.Add(1)
go func() {
defer wg.Done()
testServiceSignalReceiver(restartCmd, t)
}()
// Prepare query params for set-config mgmt REST API. // Prepare query params for set-config mgmt REST API.
queryVal := url.Values{} queryVal := url.Values{}
queryVal.Set("config", "") queryVal.Set("config", "")
@ -782,9 +772,6 @@ func TestSetConfigHandler(t *testing.T) {
t.Errorf("Got unexpected response code or body %d - %s", rec.Code, respBody) t.Errorf("Got unexpected response code or body %d - %s", rec.Code, respBody)
} }
} }
// Wait until testServiceSignalReceiver finishes its execution
wg.Wait()
} }
func TestAdminServerInfo(t *testing.T) { func TestAdminServerInfo(t *testing.T) {

@ -94,11 +94,6 @@ func (adm *AdminClient) GetConfig() ([]byte, error) {
// GetConfigKeys - returns partial json or json value from config.json of a minio setup. // GetConfigKeys - returns partial json or json value from config.json of a minio setup.
func (adm *AdminClient) GetConfigKeys(keys []string) ([]byte, error) { func (adm *AdminClient) GetConfigKeys(keys []string) ([]byte, error) {
// No TLS?
if !adm.secure {
// return nil, fmt.Errorf("credentials/configuration cannot be retrieved over an insecure connection")
}
queryVals := make(url.Values) queryVals := make(url.Values)
for _, k := range keys { for _, k := range keys {
queryVals.Add(k, "") queryVals.Add(k, "")

Loading…
Cancel
Save