fixed a bug where a new script can't be added if (#1645)

a previous one was deleted
This commit is contained in:
Alon Girmonsky 2024-12-06 14:00:05 -08:00 committed by GitHub
parent 993b8ae19e
commit d85dc58f20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -97,9 +97,12 @@ func createScript(provider *kubernetes.Provider, script misc.ConfigMapScript) (i
return
}
script.Active = kubernetes.IsActiveScript(provider, script.Title)
index = int64(len(scripts))
index = 0
if script.Title != "New Script" {
for i, v := range scripts {
if index <= i {
index = i + 1
}
if v.Title == script.Title {
index = int64(i)
}