mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-04 03:48:58 +00:00
fixed a bug where a new script can't be added if (#1645)
a previous one was deleted
This commit is contained in:
parent
993b8ae19e
commit
d85dc58f20
@ -97,9 +97,12 @@ func createScript(provider *kubernetes.Provider, script misc.ConfigMapScript) (i
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
script.Active = kubernetes.IsActiveScript(provider, script.Title)
|
script.Active = kubernetes.IsActiveScript(provider, script.Title)
|
||||||
index = int64(len(scripts))
|
index = 0
|
||||||
if script.Title != "New Script" {
|
if script.Title != "New Script" {
|
||||||
for i, v := range scripts {
|
for i, v := range scripts {
|
||||||
|
if index <= i {
|
||||||
|
index = i + 1
|
||||||
|
}
|
||||||
if v.Title == script.Title {
|
if v.Title == script.Title {
|
||||||
index = int64(i)
|
index = int64(i)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user