Skip to content

Commit c310c42

Browse files
Merge pull request #561 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents ee12034 + 59f15d2 commit c310c42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2902
-978
lines changed

.bingo/Variables.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ $(GOJQ): $(BINGO_DIR)/gojq.mod
4747
@echo "(re)installing $(GOBIN)/gojq-v0.12.17"
4848
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=gojq.mod -o=$(GOBIN)/gojq-v0.12.17 "github.com/itchyny/gojq/cmd/gojq"
4949

50-
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v2.1.6
50+
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v2.6.2
5151
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
5252
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
53-
@echo "(re)installing $(GOBIN)/golangci-lint-v2.1.6"
54-
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v2.1.6 "github.com/golangci/golangci-lint/v2/cmd/golangci-lint"
53+
@echo "(re)installing $(GOBIN)/golangci-lint-v2.6.2"
54+
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v2.6.2 "github.com/golangci/golangci-lint/v2/cmd/golangci-lint"
5555

5656
GORELEASER := $(GOBIN)/goreleaser-v1.26.2
5757
$(GORELEASER): $(BINGO_DIR)/goreleaser.mod

.bingo/golangci-lint.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
22

3-
go 1.24.2
3+
go 1.24.6
44

5-
toolchain go1.24.3
6-
7-
require github.com/golangci/golangci-lint/v2 v2.1.6 // cmd/golangci-lint
5+
require github.com/golangci/golangci-lint/v2 v2.6.2 // cmd/golangci-lint

.bingo/golangci-lint.sum

Lines changed: 156 additions & 163 deletions
Large diffs are not rendered by default.

.bingo/variables.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CRD_REF_DOCS="${GOBIN}/crd-ref-docs-v0.2.0"
1818

1919
GOJQ="${GOBIN}/gojq-v0.12.17"
2020

21-
GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.1.6"
21+
GOLANGCI_LINT="${GOBIN}/golangci-lint-v2.6.2"
2222

2323
GORELEASER="${GOBIN}/goreleaser-v1.26.2"
2424

.claude/commands/test-profile.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
description: Profile memory and CPU usage during e2e tests and analyze results
3+
---
4+
5+
# Test Profiling
6+
7+
Profile memory and CPU usage during e2e tests using the Go-based `bin/test-profile` tool.
8+
9+
## Available Commands
10+
11+
### /test-profile start [name]
12+
Start background profiling daemon. Collects heap/CPU profiles from operator-controller and catalogd every 10s.
13+
- Auto-stops after 3 consecutive collection failures (e.g., cluster teardown)
14+
- Use with any test command: `make test-e2e`, `make test-experimental-e2e`, etc.
15+
- Follow with `/test-profile stop` to generate analysis
16+
17+
**Example:**
18+
```bash
19+
/test-profile start baseline
20+
make test-e2e
21+
/test-profile stop
22+
```
23+
24+
### /test-profile stop
25+
Stop profiling daemon and generate analysis report. Cleans up port-forwards and empty profiles.
26+
27+
### /test-profile run [name] [test-target]
28+
Automated workflow: start test, profile until completion, analyze.
29+
- Default test-target: `test-e2e`
30+
- Other targets: `test-experimental-e2e`, `test-upgrade-e2e`, etc.
31+
32+
**Example:**
33+
```bash
34+
/test-profile run baseline test-e2e
35+
```
36+
37+
### /test-profile analyze [name]
38+
Analyze existing profiles in `test-profiles/[name]/`. Generates markdown report with:
39+
- Memory/CPU growth patterns
40+
- Top allocators
41+
- OpenAPI, JSON, and cache hotspots
42+
43+
### /test-profile compare [baseline] [optimized]
44+
Compare two test runs. Outputs to `test-profiles/comparisons/[baseline]-vs-[optimized].md`
45+
46+
### /test-profile collect
47+
One-time snapshot of heap/CPU profiles from running pods. Saves to `test-profiles/manual/`
48+
49+
## Implementation Steps
50+
51+
When executing commands, I will:
52+
53+
1. **Build tool**: `make build-test-profiler` (builds to `bin/test-profile`)
54+
2. **Execute command**: `./bin/test-profile [command] [args]`
55+
3. **For start/stop workflow**: Monitor daemon logs, handle errors gracefully
56+
4. **For run command**: Start test in background, monitor progress, analyze on completion
57+
5. **For analysis**: Present key findings from generated markdown reports
58+
59+
## Configuration
60+
61+
Environment variables (defaults shown):
62+
```bash
63+
TEST_PROFILE_COMPONENTS="operator-controller:olmv1-system:operator-controller-controller-manager:6060;catalogd:olmv1-system:catalogd-controller-manager:6060"
64+
TEST_PROFILE_INTERVAL=10 # seconds between collections
65+
TEST_PROFILE_CPU_DURATION=10 # CPU profiling duration
66+
TEST_PROFILE_MODE=both # both|heap|cpu
67+
TEST_PROFILE_DIR=./test-profiles
68+
TEST_PROFILE_TEST_TARGET=test-e2e
69+
```
70+
71+
## Output Structure
72+
73+
```
74+
test-profiles/
75+
├── [name]/
76+
│ ├── operator-controller/
77+
│ │ ├── heap*.pprof
78+
│ │ └── cpu*.pprof
79+
│ ├── catalogd/
80+
│ │ ├── heap*.pprof
81+
│ │ └── cpu*.pprof
82+
│ ├── profiler.log
83+
│ └── analysis.md
84+
└── comparisons/
85+
└── [name1]-vs-[name2].md
86+
```
87+
88+
## Tool Location
89+
90+
- Source: `hack/tools/test-profiling/` (Go-based CLI)
91+
- Binary: `bin/test-profile`
92+
- Make targets: `make build-test-profiler`, `make start-profiling/[name]`, `make stop-profiling`
93+
94+
## Requirements
95+
96+
- kubectl access to cluster
97+
- go tool pprof (for analysis)
98+
- Go version minimum from `hack/tools/test-profiling/go.mod` (for building)

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ vendor/
3838
\#*\#
3939
.\#*
4040

41-
# AI temp files files
42-
.claude/
41+
# AI temp/local files
42+
.claude/settings.local.json
43+
.claude/history/
44+
.claude/cache/
45+
.claude/logs/
46+
.claude/.session*
47+
.claude/*.log
4348

4449
# documentation website asset folder
4550
site

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,13 @@ generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyI
178178
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) object:headerFile="hack/boilerplate.go.txt" paths="./..."
179179

180180
.PHONY: verify
181-
verify: k8s-pin kind-verify-versions fmt generate manifests update-tls-profiles crd-ref-docs #HELP Verify all generated code is up-to-date. Runs k8s-pin instead of just tidy.
181+
verify: k8s-pin kind-verify-versions fmt generate manifests update-tls-profiles crd-ref-docs verify-bingo #HELP Verify all generated code is up-to-date. Runs k8s-pin instead of just tidy.
182182
git diff --exit-code
183183

184+
.PHONY: verify-bingo
185+
verify-bingo: $(BINGO)
186+
$(BINGO) get -v -t 15
187+
184188
.PHONY: fix-lint
185189
fix-lint: $(GOLANGCI_LINT) #EXHELP Fix lint issues
186190
$(GOLANGCI_LINT) run --fix --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
@@ -385,7 +389,7 @@ kind-clean: $(KIND) #EXHELP Delete the kind cluster.
385389
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)
386390

387391
.PHONY: kind-verify-versions
388-
kind-verify-versions:
392+
kind-verify-versions: $(KIND)
389393
env K8S_VERSION=v$(K8S_VERSION) KIND=$(KIND) GOBIN=$(GOBIN) hack/tools/validate_kindest_node.sh
390394

391395

api/v1/clusterextensionrevision_types.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package v1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
22-
"k8s.io/apimachinery/pkg/types"
2322
)
2423

2524
const (
@@ -40,6 +39,7 @@ const (
4039
ClusterExtensionRevisionReasonIncomplete = "Incomplete"
4140
ClusterExtensionRevisionReasonProgressing = "Progressing"
4241
ClusterExtensionRevisionReasonArchived = "Archived"
42+
ClusterExtensionRevisionReasonMigrated = "Migrated"
4343
)
4444

4545
// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision.
@@ -66,10 +66,6 @@ type ClusterExtensionRevisionSpec struct {
6666
// +listMapKey=name
6767
// +optional
6868
Phases []ClusterExtensionRevisionPhase `json:"phases,omitempty"`
69-
// Previous references previous revisions that objects can be adopted from.
70-
//
71-
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="previous is immutable"
72-
Previous []ClusterExtensionRevisionPrevious `json:"previous,omitempty"`
7369
}
7470

7571
// ClusterExtensionRevisionLifecycleState specifies the lifecycle state of the ClusterExtensionRevision.
@@ -108,6 +104,7 @@ type ClusterExtensionRevisionObject struct {
108104
// already existing on the cluster or even owned by another controller.
109105
//
110106
// +kubebuilder:default="Prevent"
107+
// +kubebuilder:validation:Enum=Prevent;IfNoController;None
111108
// +optional
112109
CollisionProtection CollisionProtection `json:"collisionProtection,omitempty"`
113110
}
@@ -129,13 +126,6 @@ const (
129126
CollisionProtectionNone CollisionProtection = "None"
130127
)
131128

132-
type ClusterExtensionRevisionPrevious struct {
133-
// +kubebuilder:validation:Required
134-
Name string `json:"name"`
135-
// +kubebuilder:validation:Required
136-
UID types.UID `json:"uid"`
137-
}
138-
139129
// ClusterExtensionRevisionStatus defines the observed state of a ClusterExtensionRevision.
140130
type ClusterExtensionRevisionStatus struct {
141131
// +listType=map

api/v1/zz_generated.deepcopy.go

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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()

0 commit comments

Comments
 (0)