@@ -159,13 +159,35 @@ func (r *SatResolver) SolveOperators(namespaces []string, csvs []*v1alpha1.Clust
159
159
errs = append (errs , err )
160
160
continue
161
161
}
162
+
163
+ // copy consumed fields to avoid directly mutating cache
164
+ op = & cache.Entry {
165
+ Name : op .Name ,
166
+ Replaces : op .Replaces ,
167
+ Skips : op .Skips ,
168
+ SkipRange : op .SkipRange ,
169
+ ProvidedAPIs : op .ProvidedAPIs ,
170
+ RequiredAPIs : op .RequiredAPIs ,
171
+ Version : op .Version ,
172
+ SourceInfo : & cache.OperatorSourceInfo {
173
+ Package : op .SourceInfo .Package ,
174
+ Channel : op .SourceInfo .Channel ,
175
+ StartingCSV : op .SourceInfo .StartingCSV ,
176
+ Catalog : op .SourceInfo .Catalog ,
177
+ DefaultChannel : op .SourceInfo .DefaultChannel ,
178
+ Subscription : op .SourceInfo .Subscription ,
179
+ },
180
+ Properties : op .Properties ,
181
+ BundlePath : op .BundlePath ,
182
+ Bundle : op .Bundle ,
183
+ }
162
184
if len (installableOperator .Replaces ) > 0 {
163
- op .Replaces = installableOperator .Replaces // TODO: Don't mutate object from cache!
185
+ op .Replaces = installableOperator .Replaces
164
186
}
165
187
166
188
// lookup if this installable came from a starting CSV
167
189
if _ , ok := startingCSVs [csvName ]; ok {
168
- op .SourceInfo .StartingCSV = csvName // TODO: Don't mutate object from cache!
190
+ op .SourceInfo .StartingCSV = csvName
169
191
}
170
192
171
193
operators [csvName ] = op
0 commit comments