Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add app.server.certificateDuration #469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

volkorny
Copy link

Add app.server.certificateDuration

In our service mesh, we aim to increase the certificate duration beyond 24 hours. I noticed a similar request in #176

Signed-off-by: Volodymyr Kornylyuk <[email protected]>
@cert-manager-prow cert-manager-prow bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Dec 20, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wallrj for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@cert-manager-prow cert-manager-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 20, 2024
@cert-manager-prow
Copy link
Contributor

Hi @volkorny. Thanks for your PR.

I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@cert-manager-prow cert-manager-prow bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 20, 2024
Copy link
Contributor

@erikgb erikgb left a comment

Choose a reason for hiding this comment

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

@volkorny Could you please describe a little better what you are trying to do here? Is ValidityDuration not given in the request which results in a default of 24h being applied? Or is it set, but you want all certificates to have the same ValidityDuration? With your proposed changes it seems like the latter. It is important to understand this to get good naming. I would suggest either DefaultClientCertificateDuration or FixedClientCertificateDuration - depending on what you are try to achieve.

It is also a bit harder to introduce a new field when we already have MaximumClientCertificateDuration. It should be documented how they relate to each other - depending on the implemented logic.

duration = s.opts.ClientCertificateDuration
}

log.V(2).Info("Setting certificate duration", "duration", duration)
Copy link
Contributor

Choose a reason for hiding this comment

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

If logging this, this should only be logged when overriding the duration. Why was log level 2 chosen? I would expect log level 3 after scanning through the code in this project.


if s.opts.ClientCertificateDuration > 0 {
duration = s.opts.ClientCertificateDuration
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I get a bit confused by this code that may modify duration twice (max and override)., and wonder if a shared switch statement would make this clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants