Skip to content

Add option to set custom annotations for HTTP01 resolver Ingress resources. - #2023

Merged
jetstack-bot merged 1 commit into
cert-manager:masterfrom
zeeZ:configure-annotations
Mar 23, 2020
Merged

jetstack-bot merged 1 commit into
cert-manager:masterfrom
zeeZ:configure-annotations

Conversation

@zeeZ

@zeeZ zeeZ commented Aug 29, 2019 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Adds an option to the HTTP01 solver to add arbitrary annotations to new Ingress resources.

The todo read like it was meant to just keep on piling additional annotations in there, instead I made it an option.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): replaces pull #1782 and removes a todo that's been around for over two years

Special notes for your reviewer:
I'm mostly unfamiliar with this project and its processes. This PR touches both a CRD object (by adding a new field) and changes behavior by removing the default nginx whitelist annotation on new ingresses. Is there anything else I need to do?

Release note:

Add option to set custom annotations and labels for HTTP01 resolver Ingress resources.

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. area/acme Indicates a PR directly modifies the ACME Issuer code labels Aug 29, 2019
@jetstack-bot
jetstack-bot requested a review from JoshVanL August 29, 2019 20:42
@jetstack-bot jetstack-bot added the area/acme/http01 Indicates a PR modifies ACME HTTP01 provider code label Aug 29, 2019
@jetstack-bot
jetstack-bot requested a review from munnerz August 29, 2019 20:42
@jetstack-bot jetstack-bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/api Indicates a PR directly modifies the 'pkg/apis' directory labels Aug 29, 2019
@jetstack-bot

Copy link
Copy Markdown
Contributor

Hi @zeeZ. Thanks for your PR.

I'm waiting for a jetstack or 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.

Details

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.

@jetstack-bot jetstack-bot added area/deploy Indicates a PR modifies deployment configuration size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/documentation Categorizes issue or PR as related to documentation. labels Aug 29, 2019
@zeeZ
zeeZ force-pushed the configure-annotations branch from 1085b3e to 2773f2e Compare September 13, 2019 18:28
@zeeZ
zeeZ force-pushed the configure-annotations branch from 2773f2e to 1a7c609 Compare September 22, 2019 14:56
// Optional additional annotations to add to Ingress resources used to solve ACME
// challenges that use this challenge solver.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of adding this field here directly, can you create an IngressTemplate field in a similar manner to the PodTemplate above?

@munnerz

munnerz commented Oct 16, 2019

Copy link
Copy Markdown
Member

Hey @zeeZ - sorry for the delay responding to this. I've added one comment above, if you're able to take a look into it, that'd be great 😄

This makes sense to include/resolve, I think we just need to update the API format slightly.

@munnerz

munnerz commented Oct 16, 2019

Copy link
Copy Markdown
Member

/ok-to-test

@jetstack-bot jetstack-bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 16, 2019
@zeeZ
zeeZ force-pushed the configure-annotations branch from 1a7c609 to e758d55 Compare October 17, 2019 21:03
@jetstack-bot jetstack-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 17, 2019
@zeeZ

zeeZ commented Oct 17, 2019

Copy link
Copy Markdown
Contributor Author

Hey @munnerz, I finally managed to catch up with master an tried to include your suggestion about the template. It's mostly copied from the pod ones.

I tried adding a test, but ran out of time to actually test it today, and I'm not sure if that's going in the right direction since I'm mostly unfamiliar with the project :D

@zeeZ
zeeZ force-pushed the configure-annotations branch from e758d55 to f6a0770 Compare October 18, 2019 21:08
@zeeZ

zeeZ commented Oct 25, 2019

Copy link
Copy Markdown
Contributor Author

Hi @munnerz - any more feedback?

@retest-bot

Copy link
Copy Markdown

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle stale

@jetstack-bot jetstack-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 23, 2020
@retest-bot

Copy link
Copy Markdown

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to jetstack.
/lifecycle rotten
/remove-lifecycle stale

@jetstack-bot jetstack-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 26, 2020
@jetstack-bot jetstack-bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Feb 26, 2020
@munnerz

munnerz commented Mar 5, 2020

Copy link
Copy Markdown
Member

Hey @zeeZ - sorry to get back to you after so long on this one. Would you still be interested in getting this PR updates so we can get it merged in? I think there's still quite a few people interested in the ability to customise metadata about the ingress resources we create 😄

@zeeZ
zeeZ force-pushed the configure-annotations branch from f6a0770 to ecbc232 Compare March 5, 2020 21:40
@jetstack-bot jetstack-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 5, 2020
@zeeZ

zeeZ commented Mar 5, 2020

Copy link
Copy Markdown
Contributor Author

Sure thing @munnerz! I didn't quite keep up with the changes since then, but the rebase wasn't too terrible. I'll have to chase documentation later.

/remove-lifecycle rotten

@jetstack-bot jetstack-bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 5, 2020
@zeeZ
zeeZ requested a review from munnerz March 10, 2020 15:06
Comment thread pkg/apis/acme/v1alpha2/types_issuer.go Outdated
// If labels or annotations overlap with in-built values, the values here
// will override the in-built values.
// +optional
ACMEChallengeSolverHTTP01IngressObjectMeta `json:"metadata,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should remove omitempty here as it will have no effect because this field is not a pointer. Keep // +optional however as this is what dictates what our OpenAPI schema says 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For the template and meta I mostly copied the ACMEChallengeSolverHTTP01IngressPodTemplate and ACMEChallengeSolverHTTP01IngressPodObjectMeta just above. Should I add those changes there as well while I'm at it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes please! 😄

Annotations map[string]string `json:"annotations,omitempty"`

// Labels that should be added to the created ACME HTTP01 solver ingress.
Labels map[string]string `json:"labels,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Both these fields need // +optional

Comment thread pkg/apis/acme/v1alpha3/types_issuer.go Resolved
Comment thread pkg/internal/apis/acme/types_issuer.go Resolved
Comment thread pkg/issuer/acme/http/ingress.go Resolved
@zeeZ
zeeZ force-pushed the configure-annotations branch from ecbc232 to c460884 Compare March 12, 2020 20:02
@zeeZ
zeeZ force-pushed the configure-annotations branch from c460884 to 1c96ea9 Compare March 12, 2020 20:18
@munnerz

munnerz commented Mar 16, 2020

Copy link
Copy Markdown
Member

This lgtm 😄 thanks for your work going back and forth on this!

Would you mind opening a PR against the docs repo to document this new field, similar to the podTemplate documentation already there? Then we can un-hold this and get it merged in!

/lgtm
/approve
/hold
/assign

@jetstack-bot jetstack-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Mar 16, 2020
@munnerz

munnerz commented Mar 16, 2020

Copy link
Copy Markdown
Member

/milestone v0.15

@jetstack-bot jetstack-bot added this to the v0.15 milestone Mar 16, 2020
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: munnerz, zeeZ

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2020
@zeeZ

zeeZ commented Mar 19, 2020

Copy link
Copy Markdown
Contributor Author

I'll try to get it done this week.

@munnerz

munnerz commented Mar 23, 2020

Copy link
Copy Markdown
Member

Thanks for getting this together and persisting to get it merged! 😄

/hold cancel

@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2020
@munnerz

munnerz commented Mar 23, 2020

Copy link
Copy Markdown
Member

/kind feature
/remove-kind documentation

@jetstack-bot jetstack-bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/documentation Categorizes issue or PR as related to documentation. labels Mar 23, 2020
@jetstack-bot
jetstack-bot merged commit 6a16550 into cert-manager:master Mar 23, 2020
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. area/acme/http01 Indicates a PR modifies ACME HTTP01 provider code area/acme Indicates a PR directly modifies the ACME Issuer code area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants