Skip to content

CNTRLPLANE-4110: Migrate e2e encryption perf cases to ote - #2256

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
gangwgr:ote-migration-e2e-perf
Aug 17, 2026
Merged

CNTRLPLANE-4110: Migrate e2e encryption perf cases to ote#2256
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
gangwgr:ote-migration-e2e-perf

Conversation

@gangwgr

@gangwgr gangwgr commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Migrate e2e encryption perf cases to ote

Summary by CodeRabbit

  • Tests
    • Added end-to-end encryption performance coverage for configurable encryption providers.
    • Added a dedicated serial test suite for more consistent performance measurements.
    • Tests validate resource creation thresholds, readiness, parallel resource loading, and migration timing.
    • Improved reporting for encryption performance results and setup or resource-polling errors.
    • Provider selection is available through test settings or command-line options.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@gangwgr gangwgr changed the title Migrate e2e encryption perf cases to ote [WIP]Migrate e2e encryption perf cases to ote Aug 6, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The change adds a configurable encryption performance test, moves its scenario and resource helpers into the package, validates operator state and migration timing, and registers one serial suite in the external test binary.

Changes

Encryption performance testing

Layer / File(s) Summary
Performance scenario and resource operations
test/e2e-encryption-perf/encryption_perf.go
Resolves the provider from ENCRYPTION_PROVIDER or -provider. Validates operator conditions, resource creation counts, and migration timing. Creates namespaces, Secrets, and ConfigMaps, then records statistics.
Test entrypoint delegation
test/e2e-encryption-perf/encryption_perf_test.go
Delegates test execution to the shared testPerfEncryption helper.
External suite registration
cmd/cluster-kube-apiserver-operator-tests-ext/dependencymagnet.go, cmd/cluster-kube-apiserver-operator-tests-ext/main.go
Imports the encryption performance package and registers one serial suite filtered by [Suite:encryption-perf].

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GinkgoSuite
  participant testPerfEncryption
  participant KubeAPIServerOperator
  participant KubernetesAPI
  GinkgoSuite->>testPerfEncryption: pass resolved provider
  testPerfEncryption->>KubeAPIServerOperator: retrieve operator conditions
  testPerfEncryption->>KubernetesAPI: validate resources and migration timing
  testPerfEncryption->>KubernetesAPI: create namespaces, Secrets, and ConfigMaps
  KubernetesAPI-->>testPerfEncryption: return creation statistics
Loading

Suggested reviewers: benluddy, dgrisonnet, p0lyn0mial

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The test creates three namespaces and about 42,000 resources without cleanup, uses context.TODO for cluster calls, and has four require.NoError assertions without messages. Add Ginkgo cleanup for generated namespaces/resources, propagate a bounded context to every cluster operation, and add diagnostic messages to each assertion.
Microshift Test Compatibility ⚠️ Warning The new OTE Ginkgo test calls the unavailable operator.openshift.io KubeAPIServer/cluster API and has no MicroShift skip, apigroup tag, or runtime guard. Add [apigroup:operator.openshift.io], [Skipped:MicroShift], or an IsMicroShiftCluster()/g.Skip guard; otherwise run the serial MicroShift CI job.
✅ Passed checks (13 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The migrated package has only static Ginkgo titles: the fixed Describe text and fixed It text; generated resource names occur only in test setup bodies.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The serial Ginkgo test creates namespaces, Secrets, and ConfigMaps and checks encryption migration; searches found no node, affinity, topology, drain, failover, or replica assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The full PR changes only OTE registration and encryption performance tests; it adds no manifests, controllers, or scheduling constraints such as affinity, selectors, tolerations, replicas, or PDBs.
Ote Binary Stdout Contract ✅ Passed Changed OTE code has no process-level stdout writes or suite hooks; OTE configures GinkgoWriter to os.Stderr, and klog defaults logtostderr=true.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The new Ginkgo test uses Kubernetes/OpenShift API clients and in-cluster resources only; no hardcoded IPv4, IPv4 parsing, IPv6-unsafe URL construction, or external endpoint access is present.
No-Weak-Crypto ✅ Passed The PR adds no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB code. It delegates encryption to library.TestPerfEncryption and adds no custom crypto or secret comparisons.
Container-Privileges ✅ Passed The commit changes only Go test and suite-registration code. No added Kubernetes manifest or privilege setting contains privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscala...
No-Sensitive-Data-In-Logs ✅ Passed Changed code logs only resource counts and migration duration; the Secret payload is fixed non-sensitive text, with no passwords, tokens, API keys, PII, or customer data logged.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the migration of end-to-end encryption performance tests to OTE.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from benluddy and dgrisonnet August 6, 2026 07:04
@gangwgr
gangwgr force-pushed the ote-migration-e2e-perf branch from 9609ee5 to a148eab Compare August 6, 2026 07:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
test/e2e-encryption-perf/encryption_perf.go (1)

67-90: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Replace the require.NoError pattern with a direct failure call.

Each branch builds an error that is always non-nil, then passes it to require.NoError. The intent is a direct failure. require.Failf states the intent and removes the unused errors construction. Add the missing failure detail to the assertion message, as the coding guidelines require meaningful failure messages.

Note that errorStore is accepted but never inspected. If the loader records creation errors there, reporting them would make a failed threshold much easier to diagnose.

♻️ Proposed refactor
 		AssertDBPopulatedFunc: func(t testing.TB, errorStore map[string]int, statStore map[string]int) {
 			secretsCount, ok := statStore[secretsStatsKey]
 			if !ok {
-				err := errors.New("missing secrets count stats, can't continue the test")
-				require.NoError(t, err)
+				require.Failf(t, "missing secrets count stats", "key %q not found in statStore, errorStore: %v", secretsStatsKey, errorStore)
 			}
-			if secretsCount < 25000 {
-				err := fmt.Errorf("expected to create at least 25000 secrets but %d were created", secretsCount)
-				require.NoError(t, err)
-			}
+			require.GreaterOrEqualf(t, secretsCount, 25000,
+				"expected to create at least 25000 secrets, errorStore: %v", errorStore)
 			t.Logf("Created %d secrets", secretsCount)
 
 			configMpasCount, ok := statStore[cmStatsKey]
 			if !ok {
-				err := errors.New("missing configmaps count stats, can't continue the test")
-				require.NoError(t, err)
+				require.Failf(t, "missing configmaps count stats", "key %q not found in statStore, errorStore: %v", cmStatsKey, errorStore)
 			}
-			if configMpasCount < 14000 {
-				err := fmt.Errorf("expected to create at least 14000 configmaps but %d were created", configMpasCount)
-				require.NoError(t, err)
-			}
+			require.GreaterOrEqualf(t, configMpasCount, 14000,
+				"expected to create at least 14000 configmaps, errorStore: %v", errorStore)
 			t.Logf("Created %d configmaps", configMpasCount)
-
 		},

Remove the errors import if no other use remains.

As per coding guidelines: "Assertions should include meaningful failure messages that help diagnose what went wrong."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e-encryption-perf/encryption_perf.go` around lines 67 - 90, Update
AssertDBPopulatedFunc to replace each always-failing require.NoError call with
require.Failf using meaningful failure messages that include the missing-stat or
threshold details. Remove the errors import if it is no longer used, and inspect
errorStore to include recorded creation errors in the failure diagnostics when
available.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/e2e-encryption-perf/encryption_perf.go`:
- Around line 98-106: Update the test setup around DBLoaderFunc to capture each
namespace generated by createNamespace, then register cleanup via AfterEach or
DeferCleanup that deletes all three namespaces after the test. Ensure cleanup
runs even when the test fails and preserves the existing resource-generation
flow.
- Around line 32-45: The configurable encryption-perf spec currently reads the
unparsed provider flag when executed through OTE, causing it to default to
AESCBC and duplicate the dedicated AESCBC spec. Update testPerfEncryption’s
provider selection in the encryption-perf registration to use an OTE-supported
input such as an environment variable, or remove the configurable spec while
preserving the explicit AESCBC and AESGCM specs.

---

Nitpick comments:
In `@test/e2e-encryption-perf/encryption_perf.go`:
- Around line 67-90: Update AssertDBPopulatedFunc to replace each always-failing
require.NoError call with require.Failf using meaningful failure messages that
include the missing-stat or threshold details. Remove the errors import if it is
no longer used, and inspect errorStore to include recorded creation errors in
the failure diagnostics when available.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 33372aa8-900f-4b3f-8f3c-64546b9a553e

📥 Commits

Reviewing files that changed from the base of the PR and between 9d3d16c and a148eab.

📒 Files selected for processing (4)
  • cmd/cluster-kube-apiserver-operator-tests-ext/dependencymagnet.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
  • test/e2e-encryption-perf/encryption_perf.go
  • test/e2e-encryption-perf/encryption_perf_test.go

Comment thread test/e2e-encryption-perf/encryption_perf.go
Comment on lines +98 to +106
DBLoaderWorkers: 3,
DBLoaderFunc: library.DBLoaderRepeat(1, true,
createNamespace,
waitUntilNamespaceActive,
library.DBLoaderRepeatParallel(5010, 50, false, createConfigMap, reportConfigMap),
library.DBLoaderRepeatParallel(9010, 50, false, createSecret, reportSecret)),
EncryptionProvider: library.EncryptionProvider{APIServerEncryption: configv1.APIServerEncryption{Type: encType}},
})
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check whether library-go's TestPerfEncryption or DBLoader deletes the loaded namespace.
set -uo pipefail

LIBDIR=$(fd -t d -p 'library-go/test/library/encryption$' vendor "${GOPATH:-$HOME/go}/pkg/mod" 2>/dev/null | head -1)
echo "lib dir: ${LIBDIR:-not found}"
if [ -n "${LIBDIR:-}" ]; then
  echo "=== outline ==="
  ast-grep outline "$LIBDIR" --items all
  echo "=== namespace deletion / cleanup ==="
  rg -nP -C4 'Namespaces\(\)\.Delete|Cleanup\(|defer .*Delete' "$LIBDIR"
  echo "=== TestPerfEncryption body ==="
  rg -nP -A60 '^func TestPerfEncryption\(' "$LIBDIR"
fi

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 14922


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== loader implementations ==="
sed -n '1,260p' vendor/github.com/openshift/library-go/test/library/encryption/perf_helpers.go

echo "=== caller and namespace lifecycle ==="
rg -n -C8 'TestPerfEncryption|createNamespace|waitUntilNamespaceActive|DBLoaderRepeat|EncryptionProvider' test/e2e-encryption-perf --glob '*.go'

echo "=== all cleanup references for generated namespaces ==="
rg -n -C5 'createNamespaceName|Delete\(.*Namespace|Namespaces\(\)|DeferCleanup|AfterEach|Cleanup' vendor/github.com/openshift/library-go/test/library/encryption test/e2e-encryption-perf --glob '*.go'

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 20862


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== object creation bodies ==="
sed -n '100,148p' test/e2e-encryption-perf/encryption_perf.go

echo "=== deterministic loader count verifier ==="
python3 - <<'PY'
runner_workers = 3
configmap_iterations = (5010 // 50) * 50
secret_iterations = (9010 // 50) * 50
namespaces = runner_workers
configmaps = runner_workers * configmap_iterations
secrets = runner_workers * secret_iterations

assert configmap_iterations == 5000
assert secret_iterations == 9000
assert namespaces == 3
assert configmaps == 15000
assert secrets == 27000
assert configmaps + secrets == 42000

print({
    "namespaces": namespaces,
    "configmaps": configmaps,
    "secrets": secrets,
    "objects": configmaps + secrets,
})
PY

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 2076


Delete the generated namespaces after the test.

The test creates 3 generated namespaces containing 15,000 ConfigMaps and 27,000 Secrets. Capture each namespace and register cleanup with AfterEach or DeferCleanup.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e-encryption-perf/encryption_perf.go` around lines 98 - 106, Update
the test setup around DBLoaderFunc to capture each namespace generated by
createNamespace, then register cleanup via AfterEach or DeferCleanup that
deletes all three namespaces after the test. Ensure cleanup runs even when the
test fails and preserves the existing resource-generation flow.

Source: Coding guidelines

@gangwgr gangwgr changed the title [WIP]Migrate e2e encryption perf cases to ote Migrate e2e encryption perf cases to ote Aug 6, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 6, 2026
@gangwgr

gangwgr commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade
/test e2e-gcp-operator-serial
/test k8s-e2e-gcp

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-operator-encryption-aescbc
/test e2e-gcp-operator-encryption-aesgcm
/test e2e-gcp-operator-encryption-perf-aescbc
/test e2e-gcp-operator-encryption-perf-aesgcm
/test e2e-gcp-operator-encryption-perf-single-node
/test e2e-gcp-operator-encryption-rotation-single-node
/test e2e-gcp-operator-encryption-single-node

testPerfEncryption(g.GinkgoTB(), configv1.EncryptionType(*provider))
})

g.It("TestPerfEncryptionAESCBC [Serial][Timeout:120m][Suite:encryption-perf-aescbc]", func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have 3 test cases after the migration ?
i think that before the migration there was just a single test case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the perf test uses a -provider flag to pick the encryption provider from makefile we pass as argument TEST_E2E_ENCRYPTION_PERF_TARGETS=$(addprefix test-e2e-encryption-perf-,$(ENCRYPTION_PROVIDERS))
from ci job but in the OTE (Ginkgo) suite there's only one g.It("TestPerfEncryption", ...) spec — so it always runs with the default (aescbc). we can't pass -args -provider=aesgcm through the OTE runner.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok but how many providers have we been testing in CI in the old (current) mode/approach ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3

  1. one default for single node
  2. AESCBC
  3. AESGCM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have 3 separate jobs for each mode ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, 3 jobs

@p0lyn0mial p0lyn0mial Aug 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a mechanism in OTE to pass a "provider" flag ? thanks to that we could have a singe suite and pass different providers form the CI jobs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no mechanism but we can workaround with env var

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. i'm ok with that. thx.

})

extension.AddSuite(oteextension.Suite{
Name: "openshift/cluster-kube-apiserver-operator/encryption-perf",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we already have a new job defined ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


var provider = flag.String("provider", "aescbc", "encryption provider used by the tests")

func TestPerfEncryption(tt *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add our "standard" comment for this function ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/e2e-encryption-perf/encryption_perf.go`:
- Around line 67-88: Add operation-specific messages to each require.NoError
call in AssertDBPopulatedFunc: identify missing secrets statistics, insufficient
secrets count, missing configmap statistics, and insufficient configmap count,
while preserving the existing validation behavior.
- Around line 60-62: Replace context.TODO() in GetOperatorConditionsFunc and the
related Kubernetes loader callbacks with the test context from tt.Context(),
deriving a bounded child context for each API request. Update the wait.Poll flow
to use context-aware polling so cancellation and the 30-second deadline
interrupt stalled callbacks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9149192e-16b1-4803-b1c2-b85f60556cc6

📥 Commits

Reviewing files that changed from the base of the PR and between e5a5230 and 2aa0252.

📒 Files selected for processing (4)
  • cmd/cluster-kube-apiserver-operator-tests-ext/dependencymagnet.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
  • test/e2e-encryption-perf/encryption_perf.go
  • test/e2e-encryption-perf/encryption_perf_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • cmd/cluster-kube-apiserver-operator-tests-ext/dependencymagnet.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go

Comment on lines +60 to +62
GetOperatorConditionsFunc: func(t testing.TB) ([]operatorv1.OperatorCondition, error) {
apiServerOperator, err := operatorClient.Get(context.TODO(), "cluster", metav1.GetOptions{})
if err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline test/e2e-encryption-perf/encryption_perf.go --items all
rg -n -C 3 --type=go 'context\.TODO\(\)|context\.WithTimeout\(|wait\.Poll' test/e2e-encryption-perf

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 4849


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '34,180p' test/e2e-encryption-perf/encryption_perf.go
printf '\n-- callers and callback signatures --\n'
rg -n -C 4 --type=go 'testPerfEncryption|createSecret|createConfigMap|createNamespace|waitUntilNamespaceActive|GetOperatorConditionsFunc|AssertFunc' .
printf '\n-- Go version and testing API context support --\n'
rg -n '^(go|toolchain) ' go.mod go.work 2>/dev/null || true

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 42028


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '-- loader callback definitions and execution --'
sed -n '1,190p' vendor/github.com/openshift/library-go/test/library/encryption/perf_helpers.go
sed -n '1,55p' vendor/github.com/openshift/library-go/test/library/encryption/perf_scenarios.go

printf '%s\n' '-- polling implementation --'
rg -n -C 8 'func Poll\(|func PollWithContext\(' vendor/k8s.io/apimachinery/pkg/util/wait
printf '%s\n' '-- client request timeout handling --'
rg -n -C 5 'func \(.*\) Do\(|WithContext|Timeout' vendor/k8s.io/client-go/rest vendor/k8s.io/client-go/transport 2>/dev/null | head -220

printf '%s\n' '-- context.TODO occurrences in the reviewed file --'
rg -n 'context\.TODO\(\)' test/e2e-encryption-perf/encryption_perf.go

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 28870


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '-- test client timeout configuration --'
rg -n -C 10 'func NewClientConfigForTest|Timeout:' vendor/github.com/openshift/library-go/test/library vendor | head -240

printf '%s\n' '-- REST request timeout and execution path --'
rg -n -C 6 'func \(r \*Request\) Timeout|timeout time.Duration|http\.NewRequest|Do\(ctx' vendor/k8s.io/client-go/rest/request.go vendor/k8s.io/client-go/rest/client.go

printf '%s\n' '-- bounded-context verifier --'
python3 - <<'PY'
from pathlib import Path
import re

p = Path("test/e2e-encryption-perf/encryption_perf.go")
s = p.read_text()

todo_lines = [i for i, line in enumerate(s.splitlines(), 1)
              if "context.TODO()" in line]
assert todo_lines == [61, 118, 138, 155, 161], todo_lines

callbacks = {
    "createSecret": r"func createSecret\(([^)]*)\)",
    "createConfigMap": r"func createConfigMap\(([^)]*)\)",
    "createNamespace": r"func createNamespace\(([^)]*)\)",
    "waitUntilNamespaceActive": r"func waitUntilNamespaceActive\(([^)]*)\)",
}
for name, pattern in callbacks.items():
    match = re.search(pattern, s)
    assert match, name
    assert "context.Context" not in match.group(1), (name, match.group(1))

assert "wait.Poll(10*time.Millisecond, 30*time.Second" in s
print("context.TODO lines:", todo_lines)
print("DB loader callback parameters do not include context.Context")
print("namespace polling timeout: 30s; callback request context: context.TODO()")
PY

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 26024


Thread bounded contexts through all Kubernetes API calls.

context.TODO() does not carry test cancellation or a request deadline. If a request stalls, wait.Poll cannot enforce its 30-second timeout because it waits for the callback to return. Pass tt.Context() through the loader callbacks, use bounded child contexts for each request, and use context-aware polling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e-encryption-perf/encryption_perf.go` around lines 60 - 62, Replace
context.TODO() in GetOperatorConditionsFunc and the related Kubernetes loader
callbacks with the test context from tt.Context(), deriving a bounded child
context for each API request. Update the wait.Poll flow to use context-aware
polling so cancellation and the 30-second deadline interrupt stalled callbacks.

Source: Path instructions

Comment thread test/e2e-encryption-perf/encryption_perf.go
@gangwgr

gangwgr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade
/test e2e-gcp-operator-serial
/test k8s-e2e-gcp

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-operator-encryption-aescbc
/test e2e-gcp-operator-encryption-aesgcm
/test e2e-gcp-operator-encryption-perf-aescbc
/test e2e-gcp-operator-encryption-perf-aesgcm
/test e2e-gcp-operator-encryption-perf-single-node
/test e2e-gcp-operator-encryption-rotation-single-node
/test e2e-gcp-operator-encryption-single-node

@gangwgr

gangwgr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-single-node

@gangwgr

gangwgr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-single-node

@gangwgr
gangwgr force-pushed the ote-migration-e2e-perf branch from 35a2971 to 517a68b Compare August 10, 2026 08:52

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/e2e-encryption-perf/encryption_perf.go`:
- Around line 38-39: Update the ENCRYPTION_PROVIDER handling in
TestPerfEncryption to validate the environment value before any database
population or performance-test setup begins. Accept only the aescbc and aesgcm
values defined by the Makefile, and immediately report invalid or unsupported
values instead of converting arbitrary strings with configv1.EncryptionType.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6f2069af-e34c-43fb-804d-e7ad48583908

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa0252 and 35a2971.

📒 Files selected for processing (3)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
  • test/e2e-encryption-perf/encryption_perf.go
  • test/e2e-encryption-perf/encryption_perf_test.go
💤 Files with no reviewable changes (1)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e-encryption-perf/encryption_perf_test.go

Comment on lines +38 to +39
if env := os.Getenv("ENCRYPTION_PROVIDER"); env != "" {
return configv1.EncryptionType(env)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== EncryptionType declarations and supported values ==="
rg -n -C 4 'type EncryptionType|EncryptionType[A-Za-z]+|aescbc|aesgcm' vendor test

echo "=== Provider inputs and consumers ==="
rg -n -C 5 'ENCRYPTION_PROVIDER|resolveEncryptionProvider|\*provider|testPerfEncryption' .

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 50397


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== test/e2e-encryption-perf/encryption_perf.go ==='
sed -n '1,130p' test/e2e-encryption-perf/encryption_perf.go

echo '=== direct resolver and consumer references ==='
rg -n -C 8 'resolveEncryptionProvider|ENCRYPTION_PROVIDER|TestEncryptionType\(' \
  test/e2e-encryption-perf test Makefile .github 2>/dev/null || true

echo '=== supported provider declarations ==='
sed -n '240,272p' vendor/github.com/openshift/api/config/v1/types_apiserver.go
sed -n '40,54p' vendor/github.com/openshift/library-go/test/library/encryption/helpers.go
sed -n '80,98p' vendor/github.com/openshift/library-go/test/library/encryption/scenarios.go

echo '=== standalone resolver/consumer model ==='
python3 - <<'PY'
from enum import Enum

class EncryptionType(str, Enum):
    IDENTITY = "identity"
    AESCBC = "aescbc"
    AESGCM = "aesgcm"
    KMS = "KMS"

def resolve(env_value, flag_value="aescbc"):
    # Model the changed resolver's exact conversion semantics.
    return EncryptionType(env_value) if env_value != "" else EncryptionType(flag_value)

def dispatch(provider):
    # Model the shown consumer's switch behavior.
    if provider in {"aescbc", "aesgcm", "KMS", "identity", ""}:
        return "recognized"
    return "fatal: Unknown encryption type"

for value in ["", "aescbc", "aesgcm", "identity", "KMS", "bogus", "AESCBC"]:
    try:
        resolved = resolve(value)
        print(f"{value!r} -> {resolved.value!r} -> {dispatch(resolved.value)}")
    except ValueError as exc:
        print(f"{value!r} -> conversion failure: {exc}")
PY

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 18107


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== TestPerfEncryption implementation ==='
rg -n -C 12 'func TestPerfEncryption|PerfScenario|EncryptionProvider' \
  vendor/github.com/openshift/library-go/test/library/encryption \
  test/library/encryption

echo '=== perf provider dispatch and validation ==='
rg -n -C 10 'TestEncryptionType\(|Unknown encryption type|SupportedStaticEncryptionProviders|provider.Type' \
  vendor/github.com/openshift/library-go/test/library/encryption

echo '=== exact Go conversion model ==='
python3 - <<'PY'
# A Go conversion from string to a defined string type preserves every string.
# It does not validate against declared constants.
supported = {"aescbc", "aesgcm"}
for value in ["", "aescbc", "aesgcm", "identity", "KMS", "bogus", "AESCBC"]:
    resolved = value if value else "aescbc"
    status = "accepted by resolver"
    if resolved not in supported:
        status += "; outside Makefile performance-provider allow-list"
    print(f"{value!r} -> {resolved!r}: {status}")
PY

Repository: openshift/cluster-kube-apiserver-operator

Length of output: 50398


Validate ENCRYPTION_PROVIDER before starting the performance test.

configv1.EncryptionType(env) performs no validation. TestPerfEncryption populates the database before it rejects an unknown provider, so a typo can create the full test load before failing.

Accept only aescbc and aesgcm, as defined by the Makefile, and report invalid configuration immediately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e-encryption-perf/encryption_perf.go` around lines 38 - 39, Update the
ENCRYPTION_PROVIDER handling in TestPerfEncryption to validate the environment
value before any database population or performance-test setup begins. Accept
only the aescbc and aesgcm values defined by the Makefile, and immediately
report invalid or unsupported values instead of converting arbitrary strings
with configv1.EncryptionType.

Source: Path instructions

@gangwgr
gangwgr force-pushed the ote-migration-e2e-perf branch from 517a68b to 16cf267 Compare August 10, 2026 08:57
@gangwgr

gangwgr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade
/test e2e-gcp-operator-serial
/test k8s-e2e-gcp

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-operator-encryption-aescbc
/test e2e-gcp-operator-encryption-aesgcm
/test e2e-gcp-operator-encryption-perf-aescbc
/test e2e-gcp-operator-encryption-perf-aesgcm
/test e2e-gcp-operator-encryption-perf-single-node
/test e2e-gcp-operator-encryption-rotation-single-node
/test e2e-gcp-operator-encryption-single-node

@gangwgr

gangwgr commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-aescbc-ote

@gangwgr

gangwgr commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-aesgcm-ote

@gangwgr

gangwgr commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-aws-encryption-kms-single-node

@gangwgr

gangwgr commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-single-node-ote

@gangwgr
gangwgr force-pushed the ote-migration-e2e-perf branch from 98cd77d to 96d9b8c Compare August 13, 2026 14:51
@gangwgr

gangwgr commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-single-node-ote
/test e2e-gcp-operator-encryption-perf-single-node

@gangwgr

gangwgr commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-single-node-ote

2 similar comments
@gangwgr

gangwgr commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-single-node-ote

@gangwgr

gangwgr commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-operator-encryption-perf-single-node-ote

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 14, 2026
@gangwgr
gangwgr force-pushed the ote-migration-e2e-perf branch from 96d9b8c to 6def40a Compare August 14, 2026 12:41
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 14, 2026
@gangwgr

gangwgr commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade
/test e2e-gcp-operator-serial
/test k8s-e2e-gcp

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-operator-encryption-aescbc
/test e2e-gcp-operator-encryption-aesgcm
/test e2e-gcp-operator-encryption-perf-aescbc
/test e2e-gcp-operator-encryption-perf-aescbc-ote
/test e2e-gcp-operator-encryption-perf-aesgcm
/test e2e-gcp-operator-encryption-perf-aesgcm-ote
/test e2e-gcp-operator-encryption-perf-single-node
/test e2e-gcp-operator-encryption-perf-single-node-ote
/test e2e-gcp-operator-encryption-rotation-single-node
/test e2e-gcp-operator-encryption-single-node

@gangwgr

gangwgr commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@gangwgr: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@gangwgr

gangwgr commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

/verified by ci runs

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 17, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@gangwgr: This PR has been marked as verified by ci runs.

Details

In response to this:

/verified by ci runs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gangwgr gangwgr changed the title Migrate e2e encryption perf cases to ote CNTRLPLANE-4110: Migrate e2e encryption perf cases to ote Aug 17, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 17, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 17, 2026

Copy link
Copy Markdown

@gangwgr: This pull request references CNTRLPLANE-4110 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Migrate e2e encryption perf cases to ote

Summary by CodeRabbit

  • Tests
  • Added end-to-end encryption performance coverage for configurable encryption providers.
  • Added a dedicated serial test suite for more consistent performance measurements.
  • Tests validate resource creation thresholds, readiness, parallel resource loading, and migration timing.
  • Improved reporting for encryption performance results and setup or resource-polling errors.
  • Provider selection is available through test settings or command-line options.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

secretsStatsKey = "created secrets"
)

var provider = flag.String("provider", "aescbc", "encryption provider used by the tests")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is setting this?. Currently it always falls to default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and old ci jobs also used, from ci jobs it passed in makefile for old jobs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ardaguclu

Copy link
Copy Markdown
Member

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci

openshift-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 57553b1 into openshift:main Aug 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants