Skip to content

Commit cdaadc5

Browse files
committed
Restore last-applied-config annotation in cache
This restores the last-applied-config annotation in the cache, as its absense can cause issues with clients when we update our finalizers. This increases memory utilization until we can solve the finalizer issue. Signed-off-by: Todd Short <tshort@redhat.com>
1 parent c06f27f commit cdaadc5

File tree

4 files changed

+0
-105
lines changed

4 files changed

+0
-105
lines changed

cmd/catalogd/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ import (
5959
"github.com/operator-framework/operator-controller/internal/catalogd/storage"
6060
"github.com/operator-framework/operator-controller/internal/catalogd/webhook"
6161
sharedcontrollers "github.com/operator-framework/operator-controller/internal/shared/controllers"
62-
cacheutil "github.com/operator-framework/operator-controller/internal/shared/util/cache"
6362
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
6463
httputil "github.com/operator-framework/operator-controller/internal/shared/util/http"
6564
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
@@ -255,8 +254,6 @@ func run(ctx context.Context) error {
255254

256255
cacheOptions := crcache.Options{
257256
ByObject: map[client.Object]crcache.ByObject{},
258-
// Memory optimization: strip managed fields and large annotations from cached objects
259-
DefaultTransform: cacheutil.StripManagedFieldsAndAnnotations(),
260257
}
261258

262259
saKey, err := sautil.GetServiceAccount()

cmd/operator-controller/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ import (
7878
"github.com/operator-framework/operator-controller/internal/operator-controller/rukpak/render/registryv1"
7979
"github.com/operator-framework/operator-controller/internal/operator-controller/scheme"
8080
sharedcontrollers "github.com/operator-framework/operator-controller/internal/shared/controllers"
81-
cacheutil "github.com/operator-framework/operator-controller/internal/shared/util/cache"
8281
fsutil "github.com/operator-framework/operator-controller/internal/shared/util/fs"
8382
httputil "github.com/operator-framework/operator-controller/internal/shared/util/http"
8483
imageutil "github.com/operator-framework/operator-controller/internal/shared/util/image"
@@ -233,8 +232,6 @@ func run() error {
233232
cfg.systemNamespace: {LabelSelector: k8slabels.Everything()},
234233
},
235234
DefaultLabelSelector: k8slabels.Nothing(),
236-
// Memory optimization: strip managed fields and large annotations from cached objects
237-
DefaultTransform: cacheutil.StripAnnotations(),
238235
}
239236

240237
if features.OperatorControllerFeatureGate.Enabled(features.BoxcutterRuntime) {

internal/operator-controller/applier/boxcutter.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
ocv1 "github.com/operator-framework/operator-controller/api/v1"
2929
"github.com/operator-framework/operator-controller/internal/operator-controller/controllers"
3030
"github.com/operator-framework/operator-controller/internal/operator-controller/labels"
31-
"github.com/operator-framework/operator-controller/internal/shared/util/cache"
3231
)
3332

3433
const (
@@ -68,9 +67,6 @@ func (r *SimpleRevisionGenerator) GenerateRevisionFromHelmRelease(
6867
maps.Copy(labels, objectLabels)
6968
obj.SetLabels(labels)
7069

71-
// Memory optimization: strip large annotations
72-
// Note: ApplyStripTransform never returns an error in practice
73-
_ = cache.ApplyStripAnnotationsTransform(&obj)
7470
sanitizedUnstructured(ctx, &obj)
7571

7672
objs = append(objs, ocv1.ClusterExtensionRevisionObject{
@@ -122,10 +118,6 @@ func (r *SimpleRevisionGenerator) GenerateRevision(
122118
unstr := unstructured.Unstructured{Object: unstrObj}
123119
unstr.SetGroupVersionKind(gvk)
124120

125-
// Memory optimization: strip large annotations
126-
if err := cache.ApplyStripAnnotationsTransform(&unstr); err != nil {
127-
return nil, err
128-
}
129121
sanitizedUnstructured(ctx, &unstr)
130122

131123
objs = append(objs, ocv1.ClusterExtensionRevisionObject{

internal/shared/util/cache/transform.go

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)