diff --git a/pkg/mcs/resourcemanager/server/config.go b/pkg/mcs/resourcemanager/server/config.go index a1b93763a4fd..83197b70f2e0 100644 --- a/pkg/mcs/resourcemanager/server/config.go +++ b/pkg/mcs/resourcemanager/server/config.go @@ -240,6 +240,7 @@ func (c *Config) Adjust(meta *toml.MetaData) error { if err := c.Security.Encryption.Adjust(); err != nil { return err } + c.Controller.Adjust(configMetaData.Child("controller")) configutil.AdjustInt64(&c.LeaderLease, utils.DefaultLeaderLease) diff --git a/pkg/utils/logutil/log.go b/pkg/utils/logutil/log.go index 5af668a56b26..965e37d70816 100644 --- a/pkg/utils/logutil/log.go +++ b/pkg/utils/logutil/log.go @@ -197,6 +197,8 @@ func redactInfo(input string) string { res.Grow(len(input) + 2) _, _ = res.WriteRune(leftMark) for _, c := range input { + // Double the mark character if it is already in the input string. + // to avoid the ambiguity of the redacted content. if c == leftMark || c == rightMark { _, _ = res.WriteRune(c) _, _ = res.WriteRune(c) @@ -229,6 +231,7 @@ func RedactBytes(arg []byte) []byte { case RedactInfoLogON: return []byte("?") case RedactInfoLogMark: + // Use unsafe conversion to avoid copy. return typeutil.StringToBytes(redactInfo(typeutil.BytesToString(arg))) default: }