storage/kubernetes: fix hash initialization bug

This commit is contained in:
Eric Chiang
2017-02-24 12:55:04 -08:00
parent 25b902b0c2
commit 1da2ae279c
2 changed files with 17 additions and 3 deletions

View File

@@ -72,9 +72,10 @@ func idToName(s string, h func() hash.Hash) string {
}
func offlineTokenName(userID string, connID string, h func() hash.Hash) string {
h().Write([]byte(userID))
h().Write([]byte(connID))
return strings.TrimRight(encoding.EncodeToString(h().Sum(nil)), "=")
hash := h()
hash.Write([]byte(userID))
hash.Write([]byte(connID))
return strings.TrimRight(encoding.EncodeToString(hash.Sum(nil)), "=")
}
func (c *client) urlFor(apiVersion, namespace, resource, name string) string {