K8s: StackIDs can be single digits (#82267)

This commit is contained in:
Stephanie Hingtgen
2024-02-09 18:39:58 +02:00
committed by GitHub
parent 9bc3517617
commit 54a77fa55e
2 changed files with 3 additions and 3 deletions
@@ -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: "",
},
},
{