Skip to content

ESO-424:Added e2e test cases from openshift test private.#160

Open
siddhibhor-56 wants to merge 2 commits into
openshift:mainfrom
siddhibhor-56:more-e2es
Open

ESO-424:Added e2e test cases from openshift test private.#160
siddhibhor-56 wants to merge 2 commits into
openshift:mainfrom
siddhibhor-56:more-e2es

Conversation

@siddhibhor-56

@siddhibhor-56 siddhibhor-56 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Added test cases for :-

  • AWS parameter store
  • ESO generators

Summary by CodeRabbit

  • Tests
    • Added an e2e provider suite for AWS Parameter Store and Secrets Manager, validating secret sync, updates, decoding (Auto), adoption/ownership behavior, conflict handling, and PushSecret round-trips.
    • Added generator e2e coverage for random password generation and pushing generated values to AWS Parameter Store.
    • Improved e2e suite setup reliability by waiting for the operand namespace to fully terminate before continuing.
  • Chores
    • Updated govulncheck ignore list to suppress a newly added known vulnerability ID.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Walkthrough

Adds provider-focused e2e coverage for AWS synchronization, PushSecret, ownership, decoding, and generator workflows. Adds AWS and generator resource builders, AWS API helpers, namespace termination handling, and a govulncheck vulnerability filter update.

Changes

Provider end-to-end coverage

Layer / File(s) Summary
AWS and generator resource builders
test/utils/aws_provider_resources.go, test/utils/generator_resources.go
Builds AWS stores, ExternalSecrets, PushSecrets, password generators, and generator-backed ExternalSecrets.
AWS API and credential helpers
test/utils/aws_provider_resources.go
Provides AWS session, Secrets Manager, SSM Parameter Store, and Kubernetes credential-copy operations.
Suite readiness and lifecycle
test/e2e/helpers_test.go, test/e2e/provider_e2e_test.go
Waits for operand namespace termination, verifies operator and operand readiness, initializes the suite, and cleans up test resources.
AWS and generator scenarios
test/e2e/provider_e2e_test.go
Tests synchronization, ownership, decoding, PushSecret round trips, password generation, refresh behavior, and generator-backed publishing.

Vulnerability filter update

Layer / File(s) Summary
Known vulnerability filter
hack/govulncheck.sh
Adds GO-2026-5856 to the filtered vulnerability identifiers.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProviderE2ESuite
  participant KubernetesAPI
  participant ExternalSecretsOperator
  participant AWSSecretsManager
  participant AWSSSMParameterStore
  ProviderE2ESuite->>KubernetesAPI: Create SecretStore and synchronization resources
  ExternalSecretsOperator->>AWSSecretsManager: Read or write secret values
  ExternalSecretsOperator->>AWSSSMParameterStore: Read or write parameters
  ExternalSecretsOperator->>KubernetesAPI: Reconcile Kubernetes Secret
  ProviderE2ESuite->>KubernetesAPI: Verify synchronized Secret
  ProviderE2ESuite->>AWSSecretsManager: Verify secret round trip
  ProviderE2ESuite->>AWSSSMParameterStore: Verify parameter round trip
Loading

Suggested reviewers: swghosh, mytreya-rh

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Generator suite ignores CopyAWSCredsToNamespace errors, and one It mixes cluster-scoped and namespaced generator workflows, weakening test structure. Split the generator workflow into separate It blocks and assert CopyAWSCredsToNamespace (and similar setup calls) succeeds so setup failures are visible.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning The new e2e specs call AWS Secrets Manager/SSM via the AWS SDK, so they require external connectivity outside the cluster. Gate these AWS-backed specs for disconnected CI (e.g. [Skipped:Disconnected]) or replace the external AWS calls with in-cluster/mocked endpoints.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change by describing added e2e test cases.
Docstring Coverage ✅ Passed Docstring coverage is 94.74% which is sufficient. The required threshold is 80.00%.
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 All new Ginkgo titles are static strings; dynamic values are only used in setup/assertion bodies, not in test names.
Microshift Test Compatibility ✅ Passed New e2e tests only use namespaces, Secrets, and ESO CRDs; no forbidden OpenShift APIs/namespaces or unsupported MicroShift assumptions were found.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new SNO-unsafe assumptions found; the added e2e specs use only namespaces, secrets, and ESO resources, with no multi-node/topology checks or node scheduling logic.
Topology-Aware Scheduling Compatibility ✅ Passed Only e2e tests/helpers were added; no deployment/operator scheduling constraints, node selectors, affinity, or topology spread rules were introduced.
Ote Binary Stdout Contract ✅ Passed No main/init/BeforeSuite/RunSpecs stdout writes or klog/log.Print calls were added; suite setup uses Ginkgo By/GinkgoWriter only.
No-Weak-Crypto ✅ Passed No weak crypto/custom crypto was added; changed files use AWS SDK/base64 and Gomega test assertions only, with no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or constant-time-sensitive code.
Container-Privileges ✅ Passed Only e2e Go tests/helpers and a vuln ignore script changed; no privileged, host*, allowPrivilegeEscalation, or root container manifest settings were added.
No-Sensitive-Data-In-Logs ✅ Passed No new code logs secret contents; the only added log is a generic failure warning, and artifact dumps capture metadata/pod logs rather than credentials.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: build linters: unable to load custom analyzer "kubeapilinter": bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": bin/kube-api-linter.so, plugin: not implemented


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

@openshift-ci
openshift-ci Bot requested review from mytreya-rh and swghosh June 24, 2026 11:20
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: siddhibhor-56
Once this PR has been reviewed and has the lgtm label, please assign swghosh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@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 (2)
test/e2e/helpers_test.go (1)

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

Prefer the typed phase constant over the string literal.

Comparing ns.Status.Phase against the literal "Terminating" works but is fragile to typos and refactors. Use the corev1.NamespaceTerminating constant from k8s.io/api/core/v1.

♻️ Proposed change
-	if ns.Status.Phase != "Terminating" {
+	if ns.Status.Phase != corev1.NamespaceTerminating {
 		return nil
 	}

Ensure corev1 "k8s.io/api/core/v1" is imported.

🤖 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/helpers_test.go` at line 75, The namespace phase check in the helper
test is using a fragile string literal instead of the typed Kubernetes constant.
Update the comparison in the namespace status assertion to use
corev1.NamespaceTerminating from k8s.io/api/core/v1, and ensure the test file
imports corev1 so the phase check stays consistent with the API types.
test/e2e/provider_e2e_test.go (1)

273-289: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use Fail() instead of Expect(false).To(BeTrue()) for the missing-condition case.

g.Expect(false).To(BeTrue(), ...) works but is less idiomatic; Fail("expected Ready condition with ownership error") (or StopTrying) reads more clearly when the conditions loop finds no Ready condition.

🤖 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/provider_e2e_test.go` around lines 273 - 289, The missing-condition
fallback in the ownership-error check is using a non-idiomatic false
expectation; update the `Eventually` block in `provider_e2e_test.go` so that the
`Ready` condition search in the `conds` loop uses `Fail("expected Ready
condition with ownership error")` (or `StopTrying`) when no matching condition
is found, rather than `g.Expect(false).To(BeTrue(), ...)`.
🤖 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/provider_e2e_test.go`:
- Around line 91-101: Add meaningful failure messages to the suite-setup
assertions in provider_e2e_test.go so Ginkgo failures are easier to diagnose.
Update the key Expect(...).To(Succeed()) calls around namespace creation,
VerifyPodsReadyByPrefix, and ensureExternalSecretsConfigReady in the setup flow
to include short, specific messages. Apply the same pattern consistently to
other resource-creation and readiness checks in this file, using the surrounding
helpers and setup steps as anchors.
- Around line 592-593: The AWS credential copy step is discarding the result of
CopyAWSCredsToNamespace, which can hide setup failures and cause later
SecretStore/PushSecret checks to fail confusingly. Update the provider_e2e_test
flow to assert that CopyAWSCredsToNamespace succeeds, matching the earlier AWS
Parameter Store setup pattern, and keep the failure close to the credential-copy
step for clearer test diagnostics.

---

Nitpick comments:
In `@test/e2e/helpers_test.go`:
- Line 75: The namespace phase check in the helper test is using a fragile
string literal instead of the typed Kubernetes constant. Update the comparison
in the namespace status assertion to use corev1.NamespaceTerminating from
k8s.io/api/core/v1, and ensure the test file imports corev1 so the phase check
stays consistent with the API types.

In `@test/e2e/provider_e2e_test.go`:
- Around line 273-289: The missing-condition fallback in the ownership-error
check is using a non-idiomatic false expectation; update the `Eventually` block
in `provider_e2e_test.go` so that the `Ready` condition search in the `conds`
loop uses `Fail("expected Ready condition with ownership error")` (or
`StopTrying`) when no matching condition is found, rather than
`g.Expect(false).To(BeTrue(), ...)`.
🪄 Autofix (Beta)

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: 70d9ba79-663d-4969-821c-d2d4ca8627c2

📥 Commits

Reviewing files that changed from the base of the PR and between a717728 and 3c86f7c.

⛔ Files ignored due to path filters (76)
  • test/go.sum is excluded by !**/*.sum
  • vendor/github.com/aws/aws-sdk-go/service/ssm/api.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/service.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/waiters.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/.gitignore is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/AUTHORS is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/LICENSE is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/client.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/compression.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/conn.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/join.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/json.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/mask.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/mask_safe.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/prepared.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/proxy.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/server.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/gorilla/websocket/util.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/CONTRIBUTING.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/LICENSE is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/MAINTAINERS is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/NOTICE is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/README.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/connection.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/handlers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/priority.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/LICENSE is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/PATENTS is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/dictionary.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/options.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/read.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/spdy/write.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/stream.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/moby/spdystream/utils.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/mxk/go-flowrate/LICENSE is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/mxk/go-flowrate/flowrate/flowrate.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/mxk/go-flowrate/flowrate/io.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/mxk/go-flowrate/flowrate/util.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/internal/socks/client.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/internal/socks/socks.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/proxy/dial.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/proxy/direct.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/proxy/per_host.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/proxy/proxy.go is excluded by !**/vendor/**, !vendor/**
  • vendor/golang.org/x/net/proxy/socks5.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/upgrade.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/proxy/dial.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/proxy/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/proxy/transport.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/apimachinery/third_party/forked/golang/netutil/addr.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/OWNERS is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/errorstream.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/fallback.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/reader.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/remotecommand.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/resize.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/spdy.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/v1.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/v2.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/v3.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/v4.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/v5.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/tools/remotecommand/websocket.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/transport/spdy/spdy.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/transport/websocket/roundtripper.go is excluded by !**/vendor/**, !vendor/**
  • vendor/k8s.io/client-go/util/exec/exec.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (5)
  • test/e2e/helpers_test.go
  • test/e2e/provider_e2e_test.go
  • test/go.mod
  • test/utils/aws_provider_resources.go
  • test/utils/generator_resources.go

Comment on lines +91 to +101
got, err := providerClientset.CoreV1().Namespaces().Create(ctx, namespace, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
providerTestNamespace = got.GetName()

By("Waiting for operator pod to be ready")
Expect(utils.VerifyPodsReadyByPrefix(ctx, providerClientset, operatorNamespace, []string{
operatorPodPrefix,
})).To(Succeed())

By("Ensuring ExternalSecretsConfig cluster CR exists and is Ready")
Expect(ensureExternalSecretsConfigReady(ctx)).To(Succeed())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add failure messages to key suite-setup assertions.

Several setup Expect(...).To(Succeed()) calls (e.g., namespace creation, operator/operand readiness, ensureExternalSecretsConfigReady) lack messages, making BeforeAll/BeforeEach failures harder to triage. Adding short messages like "failed to create provider test namespace" improves diagnosability. This pattern recurs throughout the file (e.g., resource creation and readiness waits).

As per coding guidelines: "Flag Ginkgo test assertions that lack meaningful failure messages."

🤖 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/provider_e2e_test.go` around lines 91 - 101, Add meaningful failure
messages to the suite-setup assertions in provider_e2e_test.go so Ginkgo
failures are easier to diagnose. Update the key Expect(...).To(Succeed()) calls
around namespace creation, VerifyPodsReadyByPrefix, and
ensureExternalSecretsConfigReady in the setup flow to include short, specific
messages. Apply the same pattern consistently to other resource-creation and
readiness checks in this file, using the surrounding helpers and setup steps as
anchors.

Source: Coding guidelines

Comment thread test/e2e/provider_e2e_test.go
@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/retest

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/retest

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/test-all

@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/test all

@siddhibhor-56 siddhibhor-56 changed the title Added e2e test cases from openshift test private. ESO-424:Added e2e test cases from openshift test private. Jul 16, 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 Jul 16, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 16, 2026

Copy link
Copy Markdown

@siddhibhor-56: This pull request references ESO-424 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Added test cases for :-

  • AWS parameter store
  • ESO generators

Summary by CodeRabbit

  • Bug Fixes
  • Improved startup checks so setup waits for the operand namespace to fully terminate before continuing, reducing flaky failures during test runs.
  • New Features
  • Added end-to-end coverage for AWS secret sync, secret ownership handling, push-based secret updates, parameter store round-trips, and password generator workflows.
  • Added shared test helpers for creating AWS-backed resources and generator-based secrets.

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.

@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/helpers_test.go`:
- Around line 68-76: Update the namespace termination check in the helper around
the namespace Get call to treat any non-nil ns.DeletionTimestamp as terminating,
regardless of ns.Status.Phase. Preserve the existing nil return for namespaces
that are neither marked for deletion nor in the Terminating phase.

In `@test/e2e/provider_e2e_test.go`:
- Around line 125-131: Label the AWS-dependent specs in the “AWS Parameter
Store” and “AWS Secrets Manager” contexts, including the [OCP-81813] push spec,
with [Skipped:Disconnected]. Preserve their existing AWS labels and test
behavior while ensuring all specs that call AWS SSM or Secrets Manager endpoints
are excluded in disconnected environments.
🪄 Autofix (Beta)

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: 4eae5032-69ca-401f-ac67-2efbf9cb4922

📥 Commits

Reviewing files that changed from the base of the PR and between 3c86f7c and 6729719.

⛔ Files ignored due to path filters (6)
  • vendor/github.com/aws/aws-sdk-go/service/ssm/api.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/service.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/aws/aws-sdk-go/service/ssm/waiters.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (4)
  • test/e2e/helpers_test.go
  • test/e2e/provider_e2e_test.go
  • test/utils/aws_provider_resources.go
  • test/utils/generator_resources.go

Comment thread test/e2e/helpers_test.go
Comment on lines +68 to +76
ns, err := clientset.CoreV1().Namespaces().Get(ctx, namespace, metav1.GetOptions{})
if k8serrors.IsNotFound(err) {
return nil
}
if err != nil {
return err
}
if ns.Status.Phase != "Terminating" {
return 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 | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '1,140p' test/e2e/helpers_test.go
printf '\n--- usages ---\n'
rg -n "Terminating|DeletionTimestamp|is.*terminating|namespace.*terminating|helpers_test.go" test/e2e -g '*.go'

Repository: openshift/external-secrets-operator

Length of output: 5754


🏁 Script executed:

sed -n '2050,2110p' test/e2e/e2e_test.go
python3 - <<'PY'
from pathlib import Path
text = Path('test/e2e/helpers_test.go').read_text()
start = text.index('func waitForNamespaceTermination')
print(text[start:text.index('// resourceType defines', start)])
PY

Repository: openshift/external-secrets-operator

Length of output: 3179


🏁 Script executed:

rg -n "ensureExternalSecretsConfigReady|waitForNamespaceTermination|OperandDefaultNamespace" test/e2e -g '*.go'
sed -n '1,90p' test/e2e/helpers_test.go

Repository: openshift/external-secrets-operator

Length of output: 4188


🌐 Web query:

Kubernetes NamespaceStatus phase Terminating deletionTimestamp before phase changes namespace deletion semantics

💡 Result:

In Kubernetes, the interaction between the Namespace.Status.Phase and the metadata.deletionTimestamp is a core mechanism of the graceful deletion process [1][2]. When a DELETE request is issued for a namespace, the API server sets the metadata.deletionTimestamp to the current server time [1][3]. This timestamp acts as the primary indicator that a graceful deletion has been requested [3][4]. Upon observing this change, the namespace-controller updates the Namespace.Status.Phase from Active to Terminating [1][5]. The deletion process follows these semantics: 1. Request and Marking: The presence of a non-nil deletionTimestamp prevents the creation of new objects within the namespace [6]. The phase transition to Terminating signals to users and system components that the namespace is undergoing cleanup and is no longer available for new workloads [7][8]. 2. Resource Cleanup: The namespace-controller begins iterating through and deleting all content (resources) associated with the namespace [1][6]. 3. Finalization: The namespace itself contains a spec.finalizers list (typically including the kubernetes finalizer) [1][2]. The namespace cannot be removed from storage until this list is empty [3][4]. The namespace-controller is responsible for purging the namespace's contents and, upon successful cleanup, removing the finalizers [1][6]. 4. Permanent Removal: Once all finalizers are removed and the deletionTimestamp is set, the namespace-controller sends a final DELETE action to the API server to permanently remove the namespace object from etcd storage [1][2]. If a namespace remains stuck in the Terminating phase, it is typically because one or more finalizers have not been removed, often due to a controller failing to successfully clean up the associated resources or a manual error (e.g., specifying a non-existent finalizer) [9][3][8]. Because the deletionTimestamp is already set, the namespace is effectively "locked" into the deletion flow until the finalizers are cleared [3][4]. Top results: [1][5][6][9][3]

Citations:


Treat a non-nil deletionTimestamp as terminating. Lines 75-76 can return while the namespace is already marked for deletion but still reports Active, letting setup continue before teardown finishes and making later readiness checks flaky.

🤖 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/helpers_test.go` around lines 68 - 76, Update the namespace
termination check in the helper around the namespace Get call to treat any
non-nil ns.DeletionTimestamp as terminating, regardless of ns.Status.Phase.
Preserve the existing nil return for namespaces that are neither marked for
deletion nor in the Terminating phase.

Comment on lines +125 to +131
Context("AWS Parameter Store", Label("Platform:AWS"), func() {
const awsCredsLocalName = "aws-creds"

BeforeAll(func() {
By("Copying AWS credentials into the test namespace")
Expect(utils.CopyAWSCredsToNamespace(ctx, providerClientset, providerTestNamespace, awsCredsLocalName)).To(Succeed())
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

AWS provider specs reach external AWS endpoints; add a disconnected guard.

The AWS Parameter Store / Secrets Manager contexts (and the [OCP-81813] push spec at Line 579) drive live calls to AWS SSM and Secrets Manager APIs, which are unreachable in disconnected/IPv6-only environments. Consider labeling these AWS-dependent specs with [Skipped:Disconnected] so they don't fail there.

As per coding guidelines: "flag tests that require connectivity to public internet hosts ... Tests failing in IPv6-only disconnected environments should be flagged unless already protected with [Skipped:Disconnected] label."

🤖 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/provider_e2e_test.go` around lines 125 - 131, Label the
AWS-dependent specs in the “AWS Parameter Store” and “AWS Secrets Manager”
contexts, including the [OCP-81813] push spec, with [Skipped:Disconnected].
Preserve their existing AWS labels and test behavior while ensuring all specs
that call AWS SSM or Secrets Manager endpoints are excluded in disconnected
environments.

Source: Coding guidelines

@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/provider_e2e_test.go`:
- Line 78: Update the provider setup around NewDynamicResourceLoader to pass the
active Ginkgo test handle instead of constructing &testing.T{}; ensure the
loader’s t.Logf and require calls use that real test context.
🪄 Autofix (Beta)

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: be6c882d-b25a-49df-ac55-384fb15ba621

📥 Commits

Reviewing files that changed from the base of the PR and between de7000b and 6f9f10a.

📒 Files selected for processing (5)
  • hack/govulncheck.sh
  • test/e2e/helpers_test.go
  • test/e2e/provider_e2e_test.go
  • test/utils/aws_provider_resources.go
  • test/utils/generator_resources.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • hack/govulncheck.sh
  • test/e2e/helpers_test.go

providerClientset = suiteClientset
providerDynamicClient = suiteDynamicClient
providerRuntimeClient = suiteRuntimeClient
providerLoader = utils.NewDynamicResourceLoader(ctx, &testing.T{})

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
# Inspect NewDynamicResourceLoader and DeleteFromUnstructured usage of *testing.T
fd -e go -t f . test/utils | xargs rg -nP 'func NewDynamicResourceLoader|DeleteFromUnstructured|CreateFromUnstructured' 
ast-grep run --pattern '$T.Fatal($$$)' --lang go test/utils
ast-grep run --pattern '$T.Fatalf($$$)' --lang go test/utils

Repository: openshift/external-secrets-operator

Length of output: 1372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- test/e2e/provider_e2e_test.go around line 78 ---'
sed -n '60,90p' test/e2e/provider_e2e_test.go | cat -n

echo
echo '--- test/utils/dynamic_resources.go around loader methods ---'
sed -n '1,220p' test/utils/dynamic_resources.go | cat -n

Repository: openshift/external-secrets-operator

Length of output: 10138


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- locate NewClientsConfigForTest ---'
rg -n "func NewClientsConfigForTest|NewClientsConfigForTest\(" test -g '*.go'

echo
echo '--- inspect the implementation ---'
file=$(rg -l "func NewClientsConfigForTest" test -g '*.go' | head -n 1)
sed -n '1,220p' "$file" | cat -n

echo
echo '--- search for zero-value testing.T patterns ---'
rg -n "&testing\.T\{\}|testing\.T\{\}" -g '*.go' .

Repository: openshift/external-secrets-operator

Length of output: 9412


Pass a real test handle to NewDynamicResourceLoader test/e2e/provider_e2e_test.go:78

DynamicResourceLoader uses t.Logf, require.NoError, and require.NotEmpty, so &testing.T{} is not a safe stand-in here. Use the active Ginkgo test handle or refactor the loader to return errors instead of depending on *testing.T.

🤖 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/provider_e2e_test.go` at line 78, Update the provider setup around
NewDynamicResourceLoader to pass the active Ginkgo test handle instead of
constructing &testing.T{}; ensure the loader’s t.Logf and require calls use that
real test context.

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

@siddhibhor-56: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-operator 6f9f10a link true /test e2e-operator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants