Storage: Update storage.Interface for backend (#90382)

This commit is contained in:
Ryan McKinley
2024-07-18 07:47:47 -07:00
committed by GitHub
parent 09e10ae9e0
commit 6e39f24588
21 changed files with 682 additions and 1061 deletions

View File

@@ -32,6 +32,11 @@ func ParseKey(raw string) (*Key, error) {
for i := 0; i < len(parts); i += 2 {
k := parts[i]
if i+1 >= len(parts) {
// Kube aggregator just appends the name to a key
if key.Group != "" && key.Resource != "" && key.Namespace == "" && key.Name == "" {
key.Name = k
return key, nil
}
return nil, fmt.Errorf("invalid key: %s", raw)
}
v := parts[i+1]
@@ -45,7 +50,7 @@ func ParseKey(raw string) (*Key, error) {
case "name":
key.Name = v
default:
return nil, fmt.Errorf("invalid key name: %s", key)
return nil, fmt.Errorf("invalid key part: %s", raw)
}
}