mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-15 23:01:33 +00:00
fix: use a cache file name with a fixed size. (#350)
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
@@ -15,7 +15,9 @@ package util
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
@@ -148,7 +150,11 @@ func ReplaceIfMatch(text string, pattern string, replacement string) string {
|
||||
}
|
||||
|
||||
func GetCacheKey(provider string, language string, sEnc string) string {
|
||||
return fmt.Sprintf("%s-%s-%s", provider, language, sEnc)
|
||||
data := fmt.Sprintf("%s-%s-%s", provider, language, sEnc)
|
||||
|
||||
hash := sha256.Sum256([]byte(data))
|
||||
|
||||
return hex.EncodeToString(hash[:])
|
||||
}
|
||||
|
||||
func GetPodListByLabels(client k.Interface,
|
||||
|
Reference in New Issue
Block a user