Skip to content

Commit f4f7657

Browse files
committed
Drop inline manifests from resolver cache.
For cached catalog entries whose content is ultimately installed from a referenced bundle image, any additional inlined manifests are bloat in the resolver cache and can be removed. Ultimately, no bundle references should be held by resolver cache entries, but the CsvJson and Object bundle fields can be zeroed out now for an immediate heap size reduction. Signed-off-by: Ben Luddy <[email protected]>
1 parent 9950875 commit f4f7657

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

pkg/controller/registry/resolver/operators.go

+13-2
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)