Skip to content

Commit 64cd2cc

Browse files
committed
Avoid modifying object retrieved from lister
Problem: Objects retrieved from the lister should not be modified. Solution: Return a DeepCopy of the object retrieved from the lister which can then be manipulated as needed. Signed-off-by: Alexander Greene <[email protected]>
1 parent e6428a1 commit 64cd2cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controller/operators/olm/operator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ func (a *Operator) operatorGroupForCSV(csv *v1alpha1.ClusterServiceVersion, logg
16271627
return nil, nil
16281628
}
16291629
logger.Debug("csv in operatorgroup")
1630-
return operatorGroup, nil
1630+
return operatorGroup.DeepCopy(), nil
16311631
default:
16321632
err = fmt.Errorf("csv created in namespace with multiple operatorgroups, can't pick one automatically")
16331633
logger.WithError(err).Warn("csv failed to become an operatorgroup member")

0 commit comments

Comments
 (0)