Skip to content

Commit 8c5dfcd

Browse files
Merge pull request #2284 from benluddy/trim-resolver-cache-bundles
Drop inline manifests from resolver cache.
2 parents 9950875 + f4f7657 commit 8c5dfcd

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

pkg/controller/registry/resolver/operators.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func NewOperatorFromBundle(bundle *api.Bundle, startingCSV string, sourceKey reg
303303
return op, nil
304304
}
305305

306-
return &Operator{
306+
o := &Operator{
307307
name: bundle.CsvName,
308308
replaces: bundle.Replaces,
309309
version: version,
@@ -313,7 +313,18 @@ func NewOperatorFromBundle(bundle *api.Bundle, startingCSV string, sourceKey reg
313313
sourceInfo: sourceInfo,
314314
properties: properties,
315315
skips: bundle.Skips,
316-
}, nil
316+
}
317+
318+
if !o.Inline() {
319+
// TODO: Extract any necessary information from the Bundle
320+
// up-front and remove the bundle field altogether. For now,
321+
// take the easy opportunity to save heap space by discarding
322+
// two of the worst offenders.
323+
bundle.CsvJson = ""
324+
bundle.Object = nil
325+
}
326+
327+
return o, nil
317328
}
318329

319330
func NewOperatorFromV1Alpha1CSV(csv *v1alpha1.ClusterServiceVersion) (*Operator, error) {

0 commit comments

Comments
 (0)