Improve groovy script checker
This commit is contained in:
parent
063f0c074b
commit
3a7a4049f3
|
|
@ -58,9 +58,11 @@ func (g *Groovy) EnsureSingle(source, name, hash, groovyScript string) (requeue
|
|||
var appliedGroovyScripts []v1alpha2.AppliedGroovyScript
|
||||
|
||||
for _, ags := range g.jenkins.Status.AppliedGroovyScripts {
|
||||
if g.configurationType != ags.ConfigurationType || ags.Source != source || ags.Name != name {
|
||||
appliedGroovyScripts = append(appliedGroovyScripts, ags)
|
||||
if g.configurationType == ags.ConfigurationType && ags.Source == source && ags.Name == name {
|
||||
continue
|
||||
}
|
||||
|
||||
appliedGroovyScripts = append(appliedGroovyScripts, ags)
|
||||
}
|
||||
appliedGroovyScripts = append(appliedGroovyScripts, v1alpha2.AppliedGroovyScript{
|
||||
ConfigurationType: g.configurationType,
|
||||
|
|
|
|||
Loading…
Reference in New Issue