Skip to content

Commit

Permalink
Merge pull request mosn#1453 from nejisama/typo/1441
Browse files Browse the repository at this point in the history
fix typo disable, issue 1441
  • Loading branch information
taoyuanyuan authored Nov 2, 2020
2 parents b2025cb + bcc6277 commit 718697c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/admin/server/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func disableLogger(w http.ResponseWriter, r *http.Request) {
if !log.ToggleLogger(string(loggerPath), true) {
log.DefaultLogger.Alertf(types.ErrorKeyAdmin, "api: %s, error: enbale %s logger failed", "disable logger", string(loggerPath))
w.WriteHeader(http.StatusBadRequest) // 400
msg := fmt.Sprintf(errMsgFmt, "disbale logger failed")
msg := fmt.Sprintf(errMsgFmt, "disable logger failed")
fmt.Fprint(w, msg)
return
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/admin/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func init() {
"/api/v1/update_loglevel": updateLogLevel,
"/api/v1/get_loglevel": getLoggerInfo,
"/api/v1/enable_log": enableLogger,
"/api/v1/disbale_log": disableLogger,
"/api/v1/disable_log": disableLogger,
"/api/v1/states": getState,
"/api/v1/plugin": pluginApi,
"/stats": statsForIstio,
Expand Down
4 changes: 2 additions & 2 deletions pkg/admin/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func postUpdateLoggerLevel(port uint32, s string) (string, error) {
func postToggleLogger(port uint32, logger string, disable bool) (string, error) {
api := "enable_log" // enable
if disable { //disable
api = "disbale_log"
api = "disable_log"
}
url := fmt.Sprintf("http://localhost:%d/api/v1/%s", port, api)
data := strings.NewReader(logger)
Expand Down Expand Up @@ -650,7 +650,7 @@ func TestHelpAPI(t *testing.T) {
"/api/v1/update_loglevel": updateLogLevel,
"/api/v1/get_loglevel": getLoggerInfo,
"/api/v1/enable_log": enableLogger,
"/api/v1/disbale_log": disableLogger,
"/api/v1/disable_log": disableLogger,
"/api/v1/states": getState,
"/stats": statsForIstio,
"/server_info": serverInfoForIstio,
Expand Down
4 changes: 2 additions & 2 deletions pkg/log/accesslog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,15 @@ func TestAccessLogDisable(t *testing.T) {

DefaultDisableAccessLog = true
format := types.DefaultAccessLogFormat
logName := "/tmp/mosn_accesslog/disbale_access.log"
logName := "/tmp/mosn_accesslog/disable_access.log"
os.Remove(logName)
accessLog, err := NewAccessLog(logName, format)
if err != nil {
t.Fatal(err)
}

ctx := prepareLocalIpv6Ctx()
// try write disbale access log nothing happened
// try write disable access log nothing happened
accessLog.Log(ctx, nil, nil, nil)
time.Sleep(time.Second)
if b, err := ioutil.ReadFile(logName); err != nil || len(b) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/log/logger_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestUpdateLoggerConfig(t *testing.T) {
t.Fatal("disable logger failed")
} else {
if !logger.Logger.Disable() {
t.Fatal("disbale logger failed")
t.Fatal("disable logger failed")
}
}
if ok := ToggleLogger(logName, false); !ok {
Expand Down
3 changes: 1 addition & 2 deletions pkg/mosn/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ func Start(c *v2.MOSNConfig) {
Mosn.Close()
}, syscall.SIGINT, syscall.SIGTERM)


Mosn.Start()
Mosn.wg.Wait()
}
Expand All @@ -337,7 +336,7 @@ func initializeTracing(config v2.TracingConfig) {
log.StartLogger.Infof("[mosn] [init tracing] enable tracing")
trace.Enable()
} else {
log.StartLogger.Infof("[mosn] [init tracing] disbale tracing")
log.StartLogger.Infof("[mosn] [init tracing] disable tracing")
trace.Disable()
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/upstream/cluster/cluster_adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func TestConnPoolUpdateTLS(t *testing.T) {
if cp2Hash.Equal(disableTLSHashValue) || cp2Hash.Equal(nil) || cp2Hash.Equal(clientSideDisableHashValue) {
t.Fatal("conn pool does not support tls")
}
// disbale tls, connpool should will be changed
// disable tls, connpool should will be changed
DisableClientSideTLS()
connPool3 := GetClusterMngAdapterInstance().ConnPoolForCluster(newMockLbContext(nil), snap2, mockProtocol)
// connpool should be changed, but old connpool should not be effected
Expand Down Expand Up @@ -494,7 +494,7 @@ func TestClusterManagerTLSUpdateTLS(t *testing.T) {
if !connPool5.TLSHashValue().Equal(connPool4.TLSHashValue()) {
t.Fatal("conn pool changed, but no config changed")
}
// disbale tls, connpool should will be changed
// disable tls, connpool should will be changed
DisableClientSideTLS()
connPool6 := GetClusterMngAdapterInstance().ConnPoolForCluster(newMockLbContext(nil), snap2, mockProtocol)
if !connPool6.TLSHashValue().Equal(clientSideDisableHashValue) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/upstream/cluster/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func TestIsSupportTLS(t *testing.T) {
//
DisableClientSideTLS()
if IsSupportTLS() {
t.Error("disbale tls, should not support tls any more")
t.Error("disable tls, should not support tls any more")
}
EnableClientSideTLS()
if !IsSupportTLS() {
t.Error("set disbale is false, still support tls")
t.Error("set disable is false, still support tls")
}
}

0 comments on commit 718697c

Please sign in to comment.