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

feat: make cert manager certificate's commonName optional #major #369

Merged
merged 10 commits into from
Jan 6, 2025

Conversation

owais-rehman
Copy link
Contributor

@owais-rehman owais-rehman commented Dec 31, 2024

Making certificate.commonName default to null. It should not default to admin-app as this field is optional. It can be set according to specific needs but it should not default to an irrelevant value.

https://cert-manager.io/docs/usage/certificate/#:~:text=%23%20Avoid%20using%20commonName,%3A%20example.com

The main reason for making this change is that whenever we try to create Certificate, its commonName field defaults to admin-app which is unexpected behavior in default scenario. Setting it to nil will make more sense.

@rasheedamir
Copy link
Member

also according to the documentation it seems one doesn't need to set the commonName for the leaf certificates which belong to the applications

README.md Outdated Show resolved Hide resolved
application/values.yaml Outdated Show resolved Hide resolved
rasheedamir
rasheedamir previously approved these changes Jan 1, 2025
application/values.yaml Outdated Show resolved Hide resolved
application/values.yaml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
application/values.yaml Outdated Show resolved Hide resolved
aslafy-z
aslafy-z previously approved these changes Jan 2, 2025
application/values.yaml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@aslafy-z
Copy link
Collaborator

aslafy-z commented Jan 2, 2025

I'm wondering if the field in the certificate value reacts correctly to a null value
We might want to add a guard to prevent null values to enter the templating helperml.

@owais-rehman
Copy link
Contributor Author

Is there anything left to modify before you guys can approve this PR?

@aslafy-z
Copy link
Collaborator

aslafy-z commented Jan 3, 2025

Can you please check my previous comment, have you done some tests ? Can you implement a unit test ?

@owais-rehman
Copy link
Contributor Author

I'm wondering if the field in the certificate value reacts correctly to a null value

I have tried by setting commonName in certificate to null vs removing this field completely. In both case tls.crt gets populated with one of the SAN value. So I think we are good in that regard.

We might want to add a guard to prevent null values to enter the templating helperml.

I am not exactly sure what changes do I need to make for this. But should we keep this PR open till this change is made?
Suggestions?

@aslafy-z
Copy link
Collaborator

aslafy-z commented Jan 6, 2025

I made the test here: #370. It looks like it's ok.

This PR introduces a breaking change, I will make it bump major version. Thank you for your contribution!

@aslafy-z aslafy-z changed the title made cert manager certificate's commonName optional feat: make cert manager certificate's commonName optional #major Jan 6, 2025
@aslafy-z aslafy-z requested a review from rasheedamir January 6, 2025 11:14
@rasheedamir rasheedamir merged commit a38d694 into master Jan 6, 2025
3 checks passed
@rasheedamir rasheedamir deleted the update-certificate-template branch January 6, 2025 11:19
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.

3 participants