Skip to content

Conversation

vrutkovs
Copy link
Member

When different controllers update the same CA bundle a conflict may occur. In that case we return an empty set of certificates and empty error.

The sync procedure should exit if either non-empty error received or cabundle is empty, as this ca bundle is later used to detemine whether target cert can be verified. If conflict occurred during CA bundle update we should restart the sync worker again - otherwise this may lead to target certificate unexpectedly regenerated. When service network target certificate is being updated it may be fatal, as the operator will lose its connection to API server and won't be able to receive an updated certificate.

@vrutkovs vrutkovs changed the title certrotation: exit when received caundle is empty OCPBUGS-60045: certrotation: exit when received cabundle is empty Aug 26, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate 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 26, 2025
@openshift-ci-robot
Copy link

@vrutkovs: This pull request references Jira Issue OCPBUGS-60045, 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:

When different controllers update the same CA bundle a conflict may occur. In that case we return an empty set of certificates and empty error.

The sync procedure should exit if either non-empty error received or cabundle is empty, as this ca bundle is later used to detemine whether target cert can be verified. If conflict occurred during CA bundle update we should restart the sync worker again - otherwise this may lead to target certificate unexpectedly regenerated. When service network target certificate is being updated it may be fatal, as the operator will lose its connection to API server and won't be able to receive an updated certificate.

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.

When different controllers update the same CA bundle a conflict may occur. In that case we return an
empty set of certificates and empty error.

The sync procedure should exit if either non-empty error received or cabundle is empty, as this ca
bundle is later used to detemine whether target cert can be verified. If conflict occurred during CA
bundle update we should restart the sync worker again - otherwise this may lead to target
certificate unexpectedly regenerated. When service network target certificate is being updated it
may be fatal, as the operator will lose its connection to API server and won't be able to receive an
updated certificate.

Co-Authored-By: Masaki Hatada <mas-hatada@nec.com>
@vrutkovs vrutkovs force-pushed the stop-on-empty-cabundle branch from efb659f to 85a6e3e Compare August 26, 2025 13:46
@vrutkovs
Copy link
Member Author

vrutkovs commented Sep 1, 2025

/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 Sep 1, 2025
@openshift-ci-robot
Copy link

@vrutkovs: This pull request references Jira Issue OCPBUGS-60045, 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 New, which is one of the valid states (NEW, ASSIGNED, POST)

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.

@wangke19
Copy link
Contributor

wangke19 commented Sep 1, 2025

This change looks solid. It addresses a potential race condition where an empty CA bundle could cause unexpected certificate regeneration. By explicitly checking for nil signingCertKeyPair and
cabundleCerts and returning an error, the sync process will be forced to retry, which is the correct behavior in this scenario.

The addition of client_cert_rotation_controller_test.go is excellent. It includes thorough test cases that cover the new error conditions, ensuring the fix is robust and well-tested.

Gemini advice: This is a good change. I'd recommend merging it. The logic is sound, and the tests are comprehensive.

I also agree.
/lgtm

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

/assign @jsafrane

@jsafrane
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Sep 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, vrutkovs, wangke19

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 Sep 22, 2025
Copy link
Contributor

openshift-ci bot commented Sep 22, 2025

@vrutkovs: all tests passed!

Full PR test history. Your PR dashboard.

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 42e91dd into openshift:master Sep 22, 2025
4 checks passed
@openshift-ci-robot
Copy link

@vrutkovs: Jira Issue OCPBUGS-60045: All pull requests linked via external trackers have merged:

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

In response to this:

When different controllers update the same CA bundle a conflict may occur. In that case we return an empty set of certificates and empty error.

The sync procedure should exit if either non-empty error received or cabundle is empty, as this ca bundle is later used to detemine whether target cert can be verified. If conflict occurred during CA bundle update we should restart the sync worker again - otherwise this may lead to target certificate unexpectedly regenerated. When service network target certificate is being updated it may be fatal, as the operator will lose its connection to API server and won't be able to receive an updated certificate.

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.

@vrutkovs
Copy link
Member Author

/cherrypick release-4.20

@openshift-cherrypick-robot

@vrutkovs: new pull request created: #2022

In response to this:

/cherrypick release-4.20

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.

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-moderate Referenced Jira bug's severity is moderate 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.

5 participants