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

Switch sample-external-issuer to issuer-lib #42

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

inteon
Copy link
Member

@inteon inteon commented Aug 14, 2023

Replaces the hand-written issuer logic with the new issuer-lib.
Should drastically reduce the complexity of this sample issuer and thus simplify writing new issuers based on this sample issuer.

@jetstack-bot jetstack-bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Aug 14, 2023
@inteon inteon marked this pull request as draft August 14, 2023 09:21
@jetstack-bot jetstack-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 14, 2023
@jetstack-bot
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 irbekrm 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

@jetstack-bot jetstack-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 24, 2023
@jetstack-bot
Copy link
Contributor

PR needs rebase.

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/test-infra repository.

go.mod Outdated Show resolved Hide resolved
go.sum Outdated Show resolved Hide resolved
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 5, 2024
@inteon inteon marked this pull request as ready for review September 10, 2024 07:38
@cert-manager-prow cert-manager-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 10, 2024
@PT-GD
Copy link
Contributor

PT-GD commented Sep 11, 2024

Huzzah! Tests now pass! Any updates needed to the README? I can take a look but probably not until this weekend at the earliest.

Even if some changes are needed, I think might be worth merging this with documentation updates to follow, as in my opinion this is a better example as a standalone repository than trying to work from the example under issuer-lib itself.

Copy link
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

I love how much this deletes! Mostly my review relates to comments and helping people to use this repo - what do you think?

Also, I think the README looks out of date and would need to be updated?

Comment on lines 48 to 50
func (vi *ClusterIssuer) GetIssuerTypeIdentifier() string {
return "clusterissuers.sample-issuer.example.com"
}
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I think this function would benefit from comments encouraging users to change this value, right? This should be changed for every issuer based on this repo

return "clusterissuers.sample-issuer.example.com"
}

var _ v1alpha1.Issuer = &ClusterIssuer{}
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I think a lot of people using sample-external-issuer might be pretty new to Go based on what we've seen in the past. I like that we have an assertion here that ClusterIssuer satisfies the interface, but this Go idiom is pretty difficult to work out if you're new (and it's hard to Google it too).

Could we add a comment to make it clear why this is here? We don't need to go full handholding with this repo but I think this might be worth it!

Comment on lines 61 to 65
func (vi *Issuer) GetIssuerTypeIdentifier() string {
return "issuers.sample-issuer.example.com"
}

var _ v1alpha1.Issuer = &Issuer{}
Copy link
Member

Choose a reason for hiding this comment

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

suggestions: as above for the cluster scoped issuer!

config/rbac/role.yaml Outdated Show resolved Hide resolved
internal/controllers/certificaterequest_controller_test.go Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I think this file is missing function level comments. Given that this is the file people are likely to need to edit, I reckon comments explaining each function's purpose would be really helpful.

Obviously people can go to issuer-lib docs but having it here in the code is no bad thing!

@inteon
Copy link
Member Author

inteon commented Sep 18, 2024

I love how much this deletes! Mostly my review relates to comments and helping people to use this repo - what do you think?

Also, I think the README looks out of date and would need to be updated?

Thank you for the feedback, I'll add the requested comments and update the README.

Copy link
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Huge improvemement over what we had before! Thanks so much for doing this!

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 19, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SgtCoDFish

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

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 19, 2024
@cert-manager-prow cert-manager-prow bot merged commit e4e7300 into cert-manager:main Sep 19, 2024
4 checks passed
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. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants