Skip to content

Conversation

@vrutkovs
Copy link
Contributor

@vrutkovs vrutkovs commented Nov 21, 2024

This ensures every secret managed by this controller has valid
not-before/not-after annotation set.
Instead of analyzing potentially sensitive secret
on customer cluster we should be able to tell if the certificate
rotation didn't happen and certificate expired by looking into
annotations.

Tested in openshift/cluster-kube-apiserver-operator#1768 and openshift/cluster-authentication-operator#742

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 21, 2024
@openshift-ci-robot
Copy link

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

  • expected the bug to target either version "4.18." or "openshift-4.18.", but it targets "4.19.0" 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:

This ensures every secret managed by this controller has valid
annotation set. Instead of analyzing potentially sensitive secret
on customer cluster we should be able to tell if the certificate
rotation didn't happen and certificate expired by looking into
annotations

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 openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Nov 21, 2024
@openshift-ci openshift-ci bot requested review from deads2k and jsafrane November 21, 2024 13:28
@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after branch 3 times, most recently from ff84afa to 91216c7 Compare November 25, 2024 14:44
@vrutkovs
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 Nov 25, 2024
@openshift-ci-robot
Copy link

@vrutkovs: This pull request references Jira Issue OCPBUGS-44842, 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.19.0) matches configured target version for branch (4.19.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.

@openshift-ci openshift-ci bot requested a review from wangke19 November 25, 2024 18:31
@vrutkovs
Copy link
Contributor Author

/retest

1 similar comment
@vrutkovs
Copy link
Contributor Author

/retest

@openshift-ci-robot
Copy link

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

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

Requesting review from QA contact:
/cc @wangke19

In response to this:

This ensures every secret managed by this controller has valid
not-before/not-after annotation set.
Instead of analyzing potentially sensitive secret
on customer cluster we should be able to tell if the certificate
rotation didn't happen and certificate expired by looking into
annotations.

Tested in openshift/cluster-kube-apiserver-operator#1768 and openshift/cluster-authentication-operator#742

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

/cherrypick release-4.18

@openshift-cherrypick-robot

@vrutkovs: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.18

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.

Copy link
Contributor

@ibihim ibihim left a comment

Choose a reason for hiding this comment

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

Technically, the wiring is fine, it makes sense to add NotBefore and NotAfter to EnsureTLSMetadataUpdate.

But the consequence is,

  • that we need to invoke it twice and
  • usually set the AdditionalAnnotations hand it down and execute it, while we could easily just set it in the given Secret.

To leverage EnsureTLSMetadataUpdate, we would need to split cert creation from injecting it into the Secret or create a more general EnsureSecretUpdate function that expects a TLS cert and then updates the metadata at once.

@vrutkovs
Copy link
Contributor Author

vrutkovs commented Jan 6, 2025

that we need to invoke it twice

Yes, its unfortunate but see below

we could easily just set it in the given Secret.

It would require us to copy paste the code which does:

  • make sure that annotations map is initialized (for newly created secrets)
  • track annotation name (it may change in the future)
  • this code can be reused in other components (e.g. ckoa PR uses AdditionalAnnotations to set not-before/not-after here as ApplySecret later already runs EnsureTLSMetadata)

@Elbehery
Copy link
Contributor

/lgtm
/approve

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

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 15, 2025
@vrutkovs
Copy link
Contributor Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 15, 2025
Comment on lines +185 to +188
// Update not-before/not-after annotations
c.AdditionalAnnotations.NotBefore = leaf.NotBefore.Format(time.RFC3339)
c.AdditionalAnnotations.NotAfter = leaf.NotAfter.Format(time.RFC3339)
_ = c.AdditionalAnnotations.EnsureTLSMetadataUpdate(&secret.ObjectMeta)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be an unit test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, added

Vadim Rutkovsky added 2 commits June 2, 2025 10:30
This ensures every secret managed by this controller has valid
annotation set. Instead of analyzing potentially sensitive secret
on customer cluster we should be able to tell if the certificate
rotation didn't happen and certificate expired by looking into
annotations
@vrutkovs vrutkovs force-pushed the cert-annotations-not-before-not-after branch from 91216c7 to f42dc03 Compare June 2, 2025 10:11
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2025
@sjenning
Copy link

sjenning commented Jun 3, 2025

/approve

1 similar comment
@jsafrane
Copy link
Contributor

jsafrane commented Jun 4, 2025

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2025
@gangwgr
Copy link

gangwgr commented Jun 9, 2025

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Elbehery, gangwgr, jsafrane, sjenning, 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:

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 lgtm Indicates that a PR is ready to be merged. label Jun 9, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 1aaedc9 and 2 for PR HEAD f42dc03 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 9, 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 ccdcf64 into openshift:master Jun 9, 2025
4 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:

This ensures every secret managed by this controller has valid
not-before/not-after annotation set.
Instead of analyzing potentially sensitive secret
on customer cluster we should be able to tell if the certificate
rotation didn't happen and certificate expired by looking into
annotations.

Tested in openshift/cluster-kube-apiserver-operator#1768 and openshift/cluster-authentication-operator#742

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

@vrutkovs: new pull request created: #1969

In response to this:

/cherrypick release-4.18

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.

@vrutkovs
Copy link
Contributor Author

vrutkovs commented Jun 9, 2025

/cherrypick release-4.19 release-4.18

@openshift-cherrypick-robot

@vrutkovs: new pull request created: #1970

In response to this:

/cherrypick release-4.19 release-4.18

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

9 participants