Skip to content

OCPBUGS-62792: Fix self-signed serving cert using 30ns lifetime instead of 30 days#2155

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
jubittajohn:fix-makeServerCert-call
Apr 13, 2026
Merged

OCPBUGS-62792: Fix self-signed serving cert using 30ns lifetime instead of 30 days#2155
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
jubittajohn:fix-makeServerCert-call

Conversation

@jubittajohn
Copy link
Copy Markdown
Contributor

@jubittajohn jubittajohn commented Apr 8, 2026

library-go crypto MakeSelfSignedCA and MakeServerCert were updated to use time.Duration instead of days, Update MakeServerCert() call in AddDefaultRotationToConfig() to reflect this change (#1943 that introduced this change)

Signed-off-by: jubittajohn <jujohn@redhat.com>
@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 Apr 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@jubittajohn: This pull request references Jira Issue OCPBUGS-62792, which is invalid:

  • expected the bug to target the "4.22.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.

Details

In response to this:

library-go crypto MakeSelfSignedCA and MakeServerCert were updated to use time.Duration instead of days, MakeServerCert() call in AddDefaultRotationToConfig() to reflect this change

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 openshift-ci Bot requested review from bertinatto and deads2k April 8, 2026 18:29
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e931fcf3-684b-4819-bfe9-ba41acd3af80

📥 Commits

Reviewing files that changed from the base of the PR and between 12d8376 and 13b8307.

📒 Files selected for processing (1)
  • pkg/controller/controllercmd/cmd.go

Walkthrough

Updated certificate validity duration in AddDefaultRotationToConfig from an ambiguous hard-coded value to an explicit 30-day time duration using time.Hour*24*30. Reordered the k8s.io/utils/clock import relative to other imports. No functional behavior changes to control flow or exported APIs.

Changes

Cohort / File(s) Summary
Certificate generation duration clarification
pkg/controller/controllercmd/cmd.go
Modified self-signed serving certificate validity from hard-coded 30 to explicit time.Hour*24*30 for clarity. Reordered k8s.io/utils/clock import relative to standard library imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@p0lyn0mial
Copy link
Copy Markdown
Contributor

/assign @sanchezl

Copy link
Copy Markdown
Contributor

@sanchezl sanchezl left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
@sanchezl
Copy link
Copy Markdown
Contributor

/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 Apr 10, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@sanchezl: This pull request references Jira Issue OCPBUGS-62792, 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.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @wangke19

Details

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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 10, 2026

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: wangke19.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

@sanchezl: This pull request references Jira Issue OCPBUGS-62792, 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.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @wangke19

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.

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.

@sanchezl
Copy link
Copy Markdown
Contributor

/retitle OCPBUGS-62792: Fix self-signed serving cert using 30ns lifetime instead of 30 days

@openshift-ci openshift-ci Bot changed the title OCPBUGS-62792: Update MakeServerCert() call in AddDefaultRotationToConfig() to use time.Duration instead of days OCPBUGS-62792: Fix self-signed serving cert using 30ns lifetime instead of 30 days Apr 10, 2026
config.ServingInfo.KeyFile = filepath.Join(temporaryCertDir, "tls.key")
// nothing can trust this, so we don't really care about hostnames
servingCert, err := ca.MakeServerCert(sets.New("localhost"), 30)
servingCert, err := ca.MakeServerCert(sets.New("localhost"), time.Hour*24*30)
Copy link
Copy Markdown
Contributor

@p0lyn0mial p0lyn0mial Apr 13, 2026

Choose a reason for hiding this comment

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

nice find!

the bug is real, yet no one has complained. I think this might be because the self-signed path almost never occurs in real clusters. When it does happen, I think the self-signed certificate only needs to last until the real certificate arrives.

worth adding a unit test ?

should we backport ?

please don't forget to bump the operators.

@p0lyn0mial
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jubittajohn, p0lyn0mial, sanchezl

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 Apr 13, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 13, 2026

@jubittajohn: 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.

@openshift-merge-bot openshift-merge-bot Bot merged commit d2db42c into openshift:master Apr 13, 2026
5 checks passed
@openshift-ci-robot
Copy link
Copy Markdown

@jubittajohn: Jira Issue OCPBUGS-62792: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or 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-62792 has not been moved to the MODIFIED state.

Details

In response to this:

library-go crypto MakeSelfSignedCA and MakeServerCert were updated to use time.Duration instead of days, Update MakeServerCert() call in AddDefaultRotationToConfig() to reflect this change (#1943 that introduced this change)

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-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.

4 participants