Skip to content

Conversation

@vrutkovs
Copy link
Contributor

@vrutkovs vrutkovs commented Jul 24, 2025

Pull in openshift/library-go#1971 to make sure most secrets created by controller would have refresh-period annotation set.

@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 Jul 24, 2025
@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 24, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 24, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jul 24, 2025
@openshift-ci-robot
Copy link

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

Requesting review from QA contact:
/cc @wangke19

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

In response to this:

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 a review from wangke19 July 24, 2025 07:01
@vrutkovs
Copy link
Contributor Author

/test e2e-aws-ovn

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2025
@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from 7a50d40 to a372921 Compare July 24, 2025 07:34
@vrutkovs
Copy link
Contributor Author

/test e2e-aws-ovn

@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from a372921 to ea69044 Compare July 24, 2025 08:05
@vrutkovs
Copy link
Contributor Author

/test e2e-aws-ovn

@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from ea69044 to fed52f9 Compare July 24, 2025 10:26
@vrutkovs
Copy link
Contributor Author

/test e2e-aws-ovn

@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from fed52f9 to c4d8d5c Compare July 24, 2025 12:57
@vrutkovs vrutkovs changed the title WIP OCPBUGS-57049: Set not-before/not-after annotations OCPBUGS-57049: Set not-before/not-after annotations Jul 24, 2025
@vrutkovs vrutkovs marked this pull request as ready for review July 24, 2025 12:58
@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 Jul 24, 2025
@openshift-ci openshift-ci bot requested review from benluddy and tkashem July 24, 2025 12:59
@vrutkovs
Copy link
Contributor Author

/cc @p0lyn0mial

@openshift-ci openshift-ci bot requested a review from p0lyn0mial July 24, 2025 12:59
@vrutkovs vrutkovs changed the title OCPBUGS-57049: Set not-before/not-after annotations OCPBUGS-44842: Set not-before/not-after annotations Jul 24, 2025
@openshift-ci-robot openshift-ci-robot added jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. and removed jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jul 24, 2025
@openshift-ci-robot
Copy link

@vrutkovs: This pull request references Jira Issue OCPBUGS-44842, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is Verified instead

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:

Pull in openshift/library-go#1971 to make sure most secrets created by controller would have refresh-period annotation set.

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
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jul 24, 2025
@wangke19
Copy link
Contributor

Found minor typo in original code,
infrastuctureLister configv1listers.InfrastructureLister
Typo in infrastuctureLister → should be infrastructureLister (spelling consistency)

@vrutkovs
Copy link
Contributor Author

good catch, fixed it

@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch 2 times, most recently from cf3ea12 to e7cd82e Compare July 28, 2025 11:55
Copy link
Contributor

@p0lyn0mial p0lyn0mial left a comment

Choose a reason for hiding this comment

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

LGTM, added some minor comments. thanks.

infrastuctureLister -> infrastructureLister
@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch 2 times, most recently from b184b35 to 096e30f Compare July 28, 2025 15:27
@wangke19
Copy link
Contributor

/retest-required

Copy link
Contributor

@p0lyn0mial p0lyn0mial left a comment

Choose a reason for hiding this comment

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

lgtm, just one more question.

@p0lyn0mial
Copy link
Contributor

@wangke19 is there anything else we should consider before merging this pr ?

@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from e2db6a1 to bb4d6a9 Compare July 30, 2025 08:59
@wangke19
Copy link
Contributor

@wangke19 is there anything else we should consider before merging this pr ?

lgtm

}
requiredSecret.Annotations[annotations.OpenShiftComponent] = "kube-apiserver"
// Copy not-before/not-after annotations from systemAdminClientCert
if systemAdminCredsSecret.Annotations != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

in go reading from nil map works, no ?
xref: https://go.dev/play/p/hrmvBX3L2Q1

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, you are right.
Reading from a nil map does NOT panic — it returns the zero value for the type.
Here’s an idiomatic and explicit version.

if val, ok := systemAdminCredsSecret.Annotations[certrotation.CertificateNotBeforeAnnotation]; ok && len(val) > 0 {
    requiredSecret.Annotations[certrotation.CertificateNotBeforeAnnotation] = val
}
if val, ok := systemAdminCredsSecret.Annotations[certrotation.CertificateNotAfterAnnotation]; ok && len(val) > 0 {
    requiredSecret.Annotations[certrotation.CertificateNotAfterAnnotation] = val
}

Copy link
Contributor

Choose a reason for hiding this comment

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

if len(systemAdminCredsSecret.Annotations[certrotation.CertificateNotBeforeAnnotation]) > 0 also works, right ?

Copy link
Contributor

@wangke19 wangke19 Jul 30, 2025

Choose a reason for hiding this comment

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

yes, the original code snippet is safe as-is regarding nil map reads. Suggestion improves readability and maintainability for other devs

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer len(systemAdminCredsSecret.Annotations[certrotation.CertificateNotBeforeAnnotation]) > 0 as it is idiomatic and more concise. maybe it is just me. do you mind brining the original version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks

@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from bb4d6a9 to 87ea901 Compare July 30, 2025 09:33
Copy not-before and not-after annotations from the system:admin secret
@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after-v2 branch from 87ea901 to 80afb73 Compare July 30, 2025 09:51
@p0lyn0mial
Copy link
Contributor

/lgtm

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

openshift-ci bot commented Jul 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: p0lyn0mial, vrutkovs

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:
  • OWNERS [p0lyn0mial,vrutkovs]

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

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 7e89682 and 2 for PR HEAD 80afb73 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 30, 2025

@vrutkovs: The following tests 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-aws-ovn-serial c4d8d5c link true /test e2e-aws-ovn-serial
ci/prow/e2e-gcp-operator-single-node 80afb73 link false /test e2e-gcp-operator-single-node
ci/prow/e2e-azure-ovn 80afb73 link false /test e2e-azure-ovn
ci/prow/e2e-aws-operator-disruptive-single-node 80afb73 link false /test e2e-aws-operator-disruptive-single-node

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 a08323d into openshift:main Jul 30, 2025
16 of 19 checks passed
@openshift-ci-robot
Copy link

@vrutkovs: Jira Issue OCPBUGS-44842: 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-44842 has not been moved to the MODIFIED state.

In response to this:

Pull in openshift/library-go#1971 to make sure most secrets created by controller would have refresh-period annotation set.

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-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-kube-apiserver-operator
This PR has been included in build ose-cluster-kube-apiserver-operator-container-v4.20.0-202507302114.p0.ga08323d.assembly.stream.el9.
All builds following this will include this PR.

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