Skip to content

Conversation

camilamacedo86
Copy link
Contributor

@camilamacedo86 camilamacedo86 commented Aug 19, 2025

This PR introduces the test that we faced intermitent issues in the OCP test env.

You can compare the migration from original: https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR149-R164

What fixed the test:

  • We wait for the webhook service cert secret to be recreated and populated before checking responsiveness.
  • We use longer timeouts, since the short ones were too tight for these envs

Tests

(agreggate 10 times)
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/52b277e0-7df6-11f0-99c5-0f4a557cd6de-0

 Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:171
    STEP: initializing Kubernetes client @ 08/20/25 19:43:20.431
    STEP: requiring OLMv1 capability on OpenShift @ 08/20/25 19:43:20.431
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/20/25 19:43:20.565
    STEP: checking if the webhook-operator-catalog exists @ 08/20/25 19:43:20.817
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/20/25 19:43:20.947
    STEP: installing the webhook operator in namespace webhook-operator-6xmxx @ 08/20/25 19:43:20.947
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/20/25 19:43:21.332
    STEP: waiting for the webhook operator to be installed @ 08/20/25 19:43:21.718
    STEP: waiting for the webhook operator's service to be ready @ 08/20/25 19:43:25.226
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/20/25 19:43:25.351
    STEP: ensuring the webhook operator's service certificate secret exists and getting its ResourceVersion @ 08/20/25 19:43:25.487
    STEP: deleting the openshift-service-ca signing-key secret @ 08/20/25 19:43:25.645
    STEP: waiting for the webhook operator's service certificate secret to be recreated with a new ResourceVersion @ 08/20/25 19:43:25.774
    STEP: checking webhook is responsive through cert rotation @ 08/20/25 19:44:36.874
    STEP: performing webhook operator cleanup @ 08/20/25 19:44:57.516
    STEP: cleanup: deleting ClusterExtension webhook-operator-6xmxx @ 08/20/25 19:44:57.516
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-6xmxx-operator-crb @ 08/20/25 19:44:57.66
    STEP: cleanup: deleting ServiceAccount webhook-operator-6xmxx-installer in namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.804
    STEP: cleanup: deleting namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.938
    STEP: waiting for namespace webhook-operator-6xmxx to be fully deleted @ 08/20/25 19:44:58.074
  • [205.468 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 205.468 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1755715343 - will randomize all specs

@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 19, 2025
@openshift-ci openshift-ci bot requested review from joelanford and tmshort August 19, 2025 23:18
Copy link
Contributor

openshift-ci bot commented Aug 19, 2025

@camilamacedo86: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/6d0aec90-7d55-11f0-9f6f-67d156b2d624-0

Copy link
Contributor

openshift-ci bot commented Aug 19, 2025

@camilamacedo86: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/7f328464-7d55-11f0-88c5-080334c7b5fe-0

@camilamacedo86 camilamacedo86 force-pushed the add-webhook-tolerance-test branch from b736e1b to fa7e8b5 Compare August 19, 2025 23:43
@camilamacedo86 camilamacedo86 changed the title WIP OCPBUGS-60564 : [OTE] Add webhook to validate openshift-service-ca certificate rotation OCPBUGS-60564 : [OTE] Add webhook to validate openshift-service-ca certificate rotation Aug 20, 2025
@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 20, 2025
@@ -167,6 +168,64 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServi
}))
})

Copy link
Contributor Author

@camilamacedo86 camilamacedo86 Aug 20, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

What was the problem?

err := k8sClient.Delete(ctx, signingKeySecret, client.PropagationPolicy(metav1.DeletePropagationBackground))
Expect(client.IgnoreNotFound(err)).ToNot(HaveOccurred())

By("waiting for the webhook operator's service certificate secret to be recreated and populated")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See that now we wait and ensure first

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need all of this extra code to check if the secret is recreated though? The next Eventually block will fail anyway if the secret isn't recreated - and we'll know why when we dump the info on failure (from line 210)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that solves the issue. It can pass locally without the explicit wait, but it fails in CI due to timing. For OPC ci/Sippy we need to be conservative, so this change gates the check until the service cert secret is actually recreated and populated before we probe the webhook—eliminating the race and avoiding flakes.

See: openshift/origin#30059 (comment)

Copy link
Contributor

@perdasilva perdasilva Aug 20, 2025

Choose a reason for hiding this comment

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

It seem we had two problems: the Eventually block's timing settings were too short and we had a potential false positive due to a race condition, i.e. we may be checking for successful creation of the resource before the deletion of the signing key secret has time to propagate and invalidate the certificate.

We may still have a similar race condition here where we check for the existence of the certificate secret before the deletion of the signing key secret had time to propagate. This could lead to flaky behavior as the next Eventually block will be doing this one's job (since anyway having a the certificate secret created and populated if anyway a precondition for success, it will need to wait for it to succeed) and it doesn't have sufficient retry budget to reach success.

I would suggest we update this to:

  • ensure the current certificate secret exists and extract its UID
  • delete the signing key certificate secret
  • wait until the certificate secret exists and had a different UID

I don't think checking that its populated is strictly necessary since this is anyway a pre-condition for the following Eventually block to succeed (and we'll be able to diagnose the problem with the failure logging). But, I'm ok with keeping it.

Great catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @perdasilva thank you for looking on this

I addressed your suggestions for we either more conservative within, but now we need wait to pass in the tests here + a new agreegate
So

/hold

Until we have all in place again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

 Will run 1 of 1 specs
  ------------------------------
  [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
  /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:171
    STEP: initializing Kubernetes client @ 08/20/25 19:43:20.431
    STEP: requiring OLMv1 capability on OpenShift @ 08/20/25 19:43:20.431
    STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/20/25 19:43:20.565
    STEP: checking if the webhook-operator-catalog exists @ 08/20/25 19:43:20.817
    STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/20/25 19:43:20.947
    STEP: installing the webhook operator in namespace webhook-operator-6xmxx @ 08/20/25 19:43:20.947
    STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/20/25 19:43:21.332
    STEP: waiting for the webhook operator to be installed @ 08/20/25 19:43:21.718
    STEP: waiting for the webhook operator's service to be ready @ 08/20/25 19:43:25.226
    STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/20/25 19:43:25.351
    STEP: ensuring the webhook operator's service certificate secret exists and getting its ResourceVersion @ 08/20/25 19:43:25.487
    STEP: deleting the openshift-service-ca signing-key secret @ 08/20/25 19:43:25.645
    STEP: waiting for the webhook operator's service certificate secret to be recreated with a new ResourceVersion @ 08/20/25 19:43:25.774
    STEP: checking webhook is responsive through cert rotation @ 08/20/25 19:44:36.874
    STEP: performing webhook operator cleanup @ 08/20/25 19:44:57.516
    STEP: cleanup: deleting ClusterExtension webhook-operator-6xmxx @ 08/20/25 19:44:57.516
    STEP: cleanup: deleting ClusterRoleBinding webhook-operator-6xmxx-operator-crb @ 08/20/25 19:44:57.66
    STEP: cleanup: deleting ServiceAccount webhook-operator-6xmxx-installer in namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.804
    STEP: cleanup: deleting namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.938
    STEP: waiting for namespace webhook-operator-6xmxx to be fully deleted @ 08/20/25 19:44:58.074
  • [205.468 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 205.468 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
  Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
  ===============================================================================================================
  Random Seed: 1755715343 - will randomize all specs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/hold

@camilamacedo86 camilamacedo86 changed the title OCPBUGS-60564 : [OTE] Add webhook to validate openshift-service-ca certificate rotation OCPBUGS-60564: [OTE] Add webhook to validate openshift-service-ca certificate rotation Aug 20, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 20, 2025
@openshift-ci-robot
Copy link

@camilamacedo86: This pull request references Jira Issue OCPBUGS-60564, which is invalid:

  • expected the bug to target the "4.20.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This PR introduces the test that we faced intermitent issues in the OCP test env.

You can compare the migration from original: https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR149-R164

What fixed the test:

  • We wait for the webhook service cert secret to be recreated and populated before checking responsiveness.
  • We use longer timeouts, since the short ones were too tight for these envs

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.

g.Expect(client.IgnoreNotFound(err)).ToNot(HaveOccurred(), fmt.Sprintf("failed to delete test resource %s: %v", resourceName, err))
}).WithTimeout(5 * time.Minute).WithPolling(10 * time.Second).Should(Succeed())

DeferCleanup(func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add debug to validate the cert in case of failures
It should us identify the issue better if we need to do so.

@camilamacedo86
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 20, 2025
@openshift-ci-robot
Copy link

@camilamacedo86: This pull request references Jira Issue OCPBUGS-60564, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (bandrade@redhat.com), skipping review request.

In response to this:

/jira refresh

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.

@camilamacedo86 camilamacedo86 force-pushed the add-webhook-tolerance-test branch from fa7e8b5 to ccef44f Compare August 20, 2025 10:28
@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2025
@camilamacedo86
Copy link
Contributor Author

camilamacedo86 commented Aug 20, 2025

/payload-aggregate periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial 10

(after address changes: #450 (comment))

Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

@camilamacedo86: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/a98be120-7db3-11f0-932d-104de548d36c-0

Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

@camilamacedo86: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b54b3bf0-7db3-11f0-9ec5-819302d54b72-0

@camilamacedo86 camilamacedo86 changed the title OCPBUGS-60564: [OTE] Add webhook to validate openshift-service-ca certificate rotation WIP: OCPBUGS-60564: [OTE] Add webhook to validate openshift-service-ca certificate rotation Aug 20, 2025
@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 20, 2025
@camilamacedo86 camilamacedo86 force-pushed the add-webhook-tolerance-test branch 2 times, most recently from aafb7b5 to f8e9ba0 Compare August 20, 2025 18:48
@camilamacedo86
Copy link
Contributor Author

/payload-aggregate periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial 10

Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

@camilamacedo86: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-ci-4.20-e2e-gcp-ovn-techpreview-serial

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/52b277e0-7df6-11f0-99c5-0f4a557cd6de-0

@openshift-ci-robot
Copy link

@camilamacedo86: This pull request references Jira Issue OCPBUGS-60564, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (bandrade@redhat.com), skipping review request.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This PR introduces the test that we faced intermitent issues in the OCP test env.

You can compare the migration from original: https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR149-R164

What fixed the test:

  • We wait for the webhook service cert secret to be recreated and populated before checking responsiveness.
  • We use longer timeouts, since the short ones were too tight for these envs
Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:171
   STEP: initializing Kubernetes client @ 08/20/25 19:43:20.431
   STEP: requiring OLMv1 capability on OpenShift @ 08/20/25 19:43:20.431
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/20/25 19:43:20.565
   STEP: checking if the webhook-operator-catalog exists @ 08/20/25 19:43:20.817
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/20/25 19:43:20.947
   STEP: installing the webhook operator in namespace webhook-operator-6xmxx @ 08/20/25 19:43:20.947
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/20/25 19:43:21.332
   STEP: waiting for the webhook operator to be installed @ 08/20/25 19:43:21.718
   STEP: waiting for the webhook operator's service to be ready @ 08/20/25 19:43:25.226
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/20/25 19:43:25.351
   STEP: ensuring the webhook operator's service certificate secret exists and getting its ResourceVersion @ 08/20/25 19:43:25.487
   STEP: deleting the openshift-service-ca signing-key secret @ 08/20/25 19:43:25.645
   STEP: waiting for the webhook operator's service certificate secret to be recreated with a new ResourceVersion @ 08/20/25 19:43:25.774
   STEP: checking webhook is responsive through cert rotation @ 08/20/25 19:44:36.874
   STEP: performing webhook operator cleanup @ 08/20/25 19:44:57.516
   STEP: cleanup: deleting ClusterExtension webhook-operator-6xmxx @ 08/20/25 19:44:57.516
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-6xmxx-operator-crb @ 08/20/25 19:44:57.66
   STEP: cleanup: deleting ServiceAccount webhook-operator-6xmxx-installer in namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.804
   STEP: cleanup: deleting namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.938
   STEP: waiting for namespace webhook-operator-6xmxx to be fully deleted @ 08/20/25 19:44:58.074
 • [205.468 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 205.468 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1755715343 - will randomize all specs

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.

@openshift-ci-robot
Copy link

@camilamacedo86: This pull request references Jira Issue OCPBUGS-60564, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (bandrade@redhat.com), skipping review request.

In response to this:

This PR introduces the test that we faced intermitent issues in the OCP test env.

You can compare the migration from original: https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR149-R164

What fixed the test:

  • We wait for the webhook service cert secret to be recreated and populated before checking responsiveness.
  • We use longer timeouts, since the short ones were too tight for these envs

Tests

(agreggate 10 times)
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/52b277e0-7df6-11f0-99c5-0f4a557cd6de-0

Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:171
   STEP: initializing Kubernetes client @ 08/20/25 19:43:20.431
   STEP: requiring OLMv1 capability on OpenShift @ 08/20/25 19:43:20.431
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/20/25 19:43:20.565
   STEP: checking if the webhook-operator-catalog exists @ 08/20/25 19:43:20.817
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/20/25 19:43:20.947
   STEP: installing the webhook operator in namespace webhook-operator-6xmxx @ 08/20/25 19:43:20.947
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/20/25 19:43:21.332
   STEP: waiting for the webhook operator to be installed @ 08/20/25 19:43:21.718
   STEP: waiting for the webhook operator's service to be ready @ 08/20/25 19:43:25.226
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/20/25 19:43:25.351
   STEP: ensuring the webhook operator's service certificate secret exists and getting its ResourceVersion @ 08/20/25 19:43:25.487
   STEP: deleting the openshift-service-ca signing-key secret @ 08/20/25 19:43:25.645
   STEP: waiting for the webhook operator's service certificate secret to be recreated with a new ResourceVersion @ 08/20/25 19:43:25.774
   STEP: checking webhook is responsive through cert rotation @ 08/20/25 19:44:36.874
   STEP: performing webhook operator cleanup @ 08/20/25 19:44:57.516
   STEP: cleanup: deleting ClusterExtension webhook-operator-6xmxx @ 08/20/25 19:44:57.516
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-6xmxx-operator-crb @ 08/20/25 19:44:57.66
   STEP: cleanup: deleting ServiceAccount webhook-operator-6xmxx-installer in namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.804
   STEP: cleanup: deleting namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.938
   STEP: waiting for namespace webhook-operator-6xmxx to be fully deleted @ 08/20/25 19:44:58.074
 • [205.468 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 205.468 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1755715343 - will randomize all specs

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.

@camilamacedo86 camilamacedo86 changed the title WIP: OCPBUGS-60564: [OTE] Add webhook to validate openshift-service-ca certificate rotation OCPBUGS-60564: [OTE] Add webhook to validate openshift-service-ca certificate rotation Aug 20, 2025
@openshift-ci openshift-ci bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Aug 20, 2025
@camilamacedo86
Copy link
Contributor Author

/test tests-extension

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2025
… certificate rotation

This change is a refactor of code from openshift/origin#30059.

Assisted-by: Gemini
@camilamacedo86 camilamacedo86 force-pushed the add-webhook-tolerance-test branch from f8e9ba0 to dbad83e Compare August 21, 2025 07:39
Eventually(func(g Gomega) {
secret := &corev1.Secret{}
err := k8sClient.Get(ctx, client.ObjectKey{Name: certificateSecretName, Namespace: webhookOperatorInstallNamespace}, secret)
g.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to get secret %s/%s", webhookOperatorInstallNamespace, certificateSecretName))
oldSecretResourceVersion = secret.ResourceVersion
g.Expect(oldSecretResourceVersion).ToNot(BeEmpty(), "expected secret ResourceVersion to not be empty")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@perdasilva I did your suggestion here as well

@camilamacedo86 camilamacedo86 force-pushed the add-webhook-tolerance-test branch from 97f848e to 38b521a Compare August 21, 2025 07:50
…tion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
@camilamacedo86 camilamacedo86 force-pushed the add-webhook-tolerance-test branch from 38b521a to f3a2561 Compare August 21, 2025 07:51
@camilamacedo86
Copy link
Contributor Author

/hold cancel

I think we can move forward with it we check that this check is not so longer flaking: #450 (comment) . https://pr-payload-tests.ci.openshift.org/runs/ci/52b277e0-7df6-11f0-99c5-0f4a557cd6de-0

We just make the other test more robust so will be less flake as well :-)
And it is passing in the e2e tests

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2025
@perdasilva
Copy link
Contributor

/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2025
Copy link
Contributor

openshift-ci bot commented Aug 21, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, perdasilva

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

The pull request process is described here

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 21, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 0bb1953 into openshift:main Aug 21, 2025
12 of 13 checks passed
@openshift-ci-robot
Copy link

@camilamacedo86: Jira Issue OCPBUGS-60564: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-60564 has not been moved to the MODIFIED state.

In response to this:

This PR introduces the test that we faced intermitent issues in the OCP test env.

You can compare the migration from original: https://github.com/openshift/origin/pull/30059/files#diff-6dd6fa78ac85235012d3c9910f8510bc1640c830a83888681bd5922cec0dffcbR149-R164

What fixed the test:

  • We wait for the webhook service cert secret to be recreated and populated before checking responsiveness.
  • We use longer timeouts, since the short ones were too tight for these envs

Tests

(agreggate 10 times)
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/52b277e0-7df6-11f0-99c5-0f4a557cd6de-0

Will run 1 of 1 specs
 ------------------------------
 [sig-olmv1][OCPFeatureGate:NewOLMWebhookProviderOpenshiftServiceCA][Skipped:Disconnected][Serial] OLMv1 operator with webhooks should be tolerant to openshift-service-ca certificate rotation
 /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension/test/webhooks.go:171
   STEP: initializing Kubernetes client @ 08/20/25 19:43:20.431
   STEP: requiring OLMv1 capability on OpenShift @ 08/20/25 19:43:20.431
   STEP: ensuring no ClusterExtension and CRD from a previous run @ 08/20/25 19:43:20.565
   STEP: checking if the webhook-operator-catalog exists @ 08/20/25 19:43:20.817
   STEP: webhook-operator catalog webhook-operator-catalog already exists, skipping creation @ 08/20/25 19:43:20.947
   STEP: installing the webhook operator in namespace webhook-operator-6xmxx @ 08/20/25 19:43:20.947
   STEP: creating a ClusterRoleBinding to cluster-admin for the webhook operator @ 08/20/25 19:43:21.332
   STEP: waiting for the webhook operator to be installed @ 08/20/25 19:43:21.718
   STEP: waiting for the webhook operator's service to be ready @ 08/20/25 19:43:25.226
   STEP: waiting for the webhook operator's service certificate secret to exist and be populated @ 08/20/25 19:43:25.351
   STEP: ensuring the webhook operator's service certificate secret exists and getting its ResourceVersion @ 08/20/25 19:43:25.487
   STEP: deleting the openshift-service-ca signing-key secret @ 08/20/25 19:43:25.645
   STEP: waiting for the webhook operator's service certificate secret to be recreated with a new ResourceVersion @ 08/20/25 19:43:25.774
   STEP: checking webhook is responsive through cert rotation @ 08/20/25 19:44:36.874
   STEP: performing webhook operator cleanup @ 08/20/25 19:44:57.516
   STEP: cleanup: deleting ClusterExtension webhook-operator-6xmxx @ 08/20/25 19:44:57.516
   STEP: cleanup: deleting ClusterRoleBinding webhook-operator-6xmxx-operator-crb @ 08/20/25 19:44:57.66
   STEP: cleanup: deleting ServiceAccount webhook-operator-6xmxx-installer in namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.804
   STEP: cleanup: deleting namespace webhook-operator-6xmxx @ 08/20/25 19:44:57.938
   STEP: waiting for namespace webhook-operator-6xmxx to be fully deleted @ 08/20/25 19:44:58.074
 • [205.468 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 205.468 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
 Running Suite:  - /Users/camilam/go/src/github/operator-framework-operator-controller/openshift/tests-extension
 ===============================================================================================================
 Random Seed: 1755715343 - will randomize all specs

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.

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/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants