K8s: StackIDs can be single digits (#82267)

This commit is contained in:
Stephanie Hingtgen 2024-02-09 09:39:58 -07:00 committed by GitHub
parent 9bc3517617
commit 54a77fa55e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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: "",
},
},
{