Skip to content

Commit 79799b9

Browse files
eedorenkoCopilot
andauthored
Update controllers/assignment_controller.go
Co-authored-by: Copilot <[email protected]>
1 parent b5e6a0f commit 79799b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controllers/assignment_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,12 +398,12 @@ func (r *AssignmentReconciler) mergeObjects(existingObject interface{}, newObjec
398398
value := newArray[i]
399399
matched := false
400400
// check if the value is a map
401-
if _, ok := value.(map[interface{}]interface{}); ok {
401+
if valueMap, ok := value.(map[interface{}]interface{}); ok {
402402
// check if the map with same "name" key exists in the existing array
403403
for j := 0; j < len(existingArray); j++ {
404404
existingValue := existingArray[j]
405405
if existingValueMap, ok := existingValue.(map[interface{}]interface{}); ok {
406-
if existingValueMap["name"] == value.(map[interface{}]interface{})["name"] {
406+
if existingValueMap["name"] == valueMap["name"] {
407407
// merge the maps
408408
existingArray[j] = r.mergeObjects(existingValue, value)
409409
matched = true

0 commit comments

Comments
 (0)