mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: StackIDs can be single digits (#82267)
This commit is contained in:
parent
9bc3517617
commit
54a77fa55e
@ -68,7 +68,7 @@ func ParseNamespace(ns string) (NamespaceInfo, error) {
|
||||
|
||||
if strings.HasPrefix(ns, "stack-") {
|
||||
info.StackID = ns[6:]
|
||||
if len(info.StackID) < 2 {
|
||||
if len(info.StackID) < 1 {
|
||||
return info, fmt.Errorf("invalid stack id")
|
||||
}
|
||||
info.OrgID = 1
|
||||
|
@ -94,11 +94,11 @@ func TestParseNamespace(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "invalid stack id (too short)",
|
||||
namespace: "stack-1",
|
||||
namespace: "stack-",
|
||||
expectErr: true,
|
||||
expected: request.NamespaceInfo{
|
||||
OrgID: -1,
|
||||
StackID: "1",
|
||||
StackID: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user