Skip to content

cert-manager.io/duration ignorred#81

Open
itay-grudev wants to merge 1 commit into
cloudflare:trunkfrom
itay-grudev:trunk
Open

cert-manager.io/duration ignorred#81
itay-grudev wants to merge 1 commit into
cloudflare:trunkfrom
itay-grudev:trunk

Conversation

@itay-grudev

@itay-grudev itay-grudev commented Feb 28, 2023

Copy link
Copy Markdown

I am having an issue where my request for certificates valid for 336h are only valid for 7 days.

After a lot of painful digging I found that Cloudflare's API documentation shows that only a subset of values is possible:

7d, 30d, 90d, 365d, 730d, 1095d, 5475d

See requested_validity.

It would have saved me a lot of time if the documentation mentioned it, so here it is for posterity.

@terinjokes

Copy link
Copy Markdown
Contributor

Can you make this a bulleted list and move to a paragraph underneath the Certificate example? I don't think it needs a section header, especially as it's not a limitation of this project.

I'd also appreciate a squashed commit, since you're already making changes.

@terinjokes

Copy link
Copy Markdown
Contributor

Also, it's not ignored, we find the closest value locally.

func closest(of int, valid []int) int {
min := math.MaxFloat64
closest := of
for _, v := range valid {
diff := math.Abs(float64(v - of))
if diff < min {
min = diff
closest = v
}
}
return closest
}

@itay-grudev

Copy link
Copy Markdown
Author

@terinjokes Done.

@terinjokes terinjokes self-assigned this Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants