mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Simple code and typo fixed.
Signed-off-by: Ri Xu <xuri.me@gmail.com>
This commit is contained in:
parent
8c1ee761d2
commit
4b71941082
@ -747,7 +747,7 @@ func (s *ServiceController) syncService(key string) error {
|
||||
var cachedService *cachedService
|
||||
var retryDelay time.Duration
|
||||
defer func() {
|
||||
glog.V(4).Infof("Finished syncing service %q (%v)", key, time.Now().Sub(startTime))
|
||||
glog.V(4).Infof("Finished syncing service %q (%v)", key, time.Since(startTime))
|
||||
}()
|
||||
|
||||
namespace, name, err := cache.SplitMetaNamespaceKey(key)
|
||||
|
@ -105,10 +105,10 @@ func wrapString(str string, wrap int) []string {
|
||||
l := line{wrap: wrap}
|
||||
|
||||
for _, word := range words {
|
||||
if l.Add(word) == false {
|
||||
if !l.Add(word) {
|
||||
wrapped = append(wrapped, l.String())
|
||||
l = line{wrap: wrap}
|
||||
if l.Add(word) == false {
|
||||
if !l.Add(word) {
|
||||
panic("Couldn't add to empty line.")
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ func (p Plugin) Validate() error {
|
||||
if len(p.Name) == 0 || len(p.ShortDesc) == 0 || (len(p.Command) == 0 && len(p.Tree) == 0) {
|
||||
return ErrIncompletePlugin
|
||||
}
|
||||
if strings.Index(p.Name, " ") > -1 {
|
||||
if strings.Contains(p.Name, " ") {
|
||||
return ErrInvalidPluginName
|
||||
}
|
||||
for _, flag := range p.Flags {
|
||||
@ -102,7 +102,7 @@ func (f Flag) Validate() error {
|
||||
if len(f.Name) == 0 || len(f.Desc) == 0 {
|
||||
return ErrIncompleteFlag
|
||||
}
|
||||
if strings.Index(f.Name, " ") > -1 {
|
||||
if strings.Contains(f.Name, " ") {
|
||||
return ErrInvalidFlagName
|
||||
}
|
||||
return f.ValidateShorthand()
|
||||
|
Loading…
Reference in New Issue
Block a user