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

cert-manager.io/duration ignorred #81

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

Conversation

itay-grudev
Copy link

I am having an issue where my request for certificates valid for 336h are only valid for a 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
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
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
Author

@terinjokes Done.

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