Repository navigation
feat(chart): support namespaced Issuers - #138
Conversation
Add pubgrade.ingress.https.issuerKind (ClusterIssuer by default, also if null, or Issuer), as in FOCA's library chart. Configured Ingress annotations now take precedence over the chart's issuer annotation and null removes it, instead of rendering a duplicate key. Rendering fails on other kinds, without an issuer, and if the annotations name both kinds. Chart tests and deployment docs cover both kinds. Closes #136 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Render the issuer's name as a string, so that names YAML reads as numbers stay valid annotations, and check the error message of each failing render. Cover overrides and removal for namespaced Issuers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Reviewer's GuideImplementationBuild the Ingress issuer annotation from the selected issuer kind, apply user annotations as overrides or removals, and reject invalid kinds or conflicting issuer annotations.
ConfigurationExpose
DocumentationExplain certificate and Ingress behavior, including namespaced Issuers and configuring a second hostname.
TestsVerify issuer-kind defaults and validation, HTTPS behavior, annotation overrides and removals, numeric names, and failure messages.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #138 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 19
Lines 1772 1772
=========================================
Hits 1772 1772 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 091f871 #136 feat(chart): support namespaced cert-manager Issuers · 3 of 4 met
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="helm/templates/pubgrade/ingress.yaml" line_range="26" />
<code_context>
+{{- $issuerKind = $https.issuerKind }}
+{{- if not (has $issuerKind (list "ClusterIssuer" "Issuer")) }}
+{{- fail (printf "pubgrade.ingress.https.issuerKind must be ClusterIssuer or Issuer, not %q" (toString $issuerKind)) }}
+{{- end }}
+{{- end }}
+{{- $annotations := dict }}
</code_context>
<issue_to_address>
**Numeric issuer rejected**
When the HTTPS issuer is supplied as numeric zero, `required` checks `$https.issuer` before `toString` and treats `0` as empty, so Helm aborts rendering instead of producing an Ingress with issuer name `"0"`.
Validate the issuer without treating numeric zero as absent, then convert it to a string.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and with HTTPS enabled, issuerKind determines whether cert-manager uses a namespaced Issuer or a ClusterIssuer to issue and renew the certificate served by the Ingress. If that selection is wrong, reverting may stop future issuance but will not undo a certificate already issued or stored; it would need to be replaced or revoked.
Blocking findings: helm/templates/pubgrade/ingress.yaml:26
Summary
Closes #136.
pubgrade.ingress.https.issuerKind, as in FOCA's library chart (feat(chart): support namespaced Issuers foca#820):ClusterIssuer(the default, also when unset ornull) orIssuer, which setscert-manager.io/issuerinstead ofcert-manager.io/cluster-issuer.pubgrade.ingress.annotationsnow take precedence over the chart's issuer annotation, andnullremoves it (before, setting the same key rendered it twice).issuerwhile HTTPS is on, and if the annotations name both a ClusterIssuer and an Issuer (cert-manager refuses such Ingresses). The issuer name is always rendered as a string.docs/deployment.md, with a namespaced Let's Encrypt Issuer on OpenShift and a second host name via a second Ingress;helm/values.yamlcomments.letsencrypt-prodinstead of"letsencrypt-prod"; same YAML string).Decisions taken
extraHosts(optional point 2 of the issue): not added; the docs describe a second Ingress for a second host name, as FOCA's docs do. Moving the chart onto FOCA's library chart stays a separate issue if wanted.docs/development.md). Suggested bullet for the next notes, under Features: "Chart:pubgrade.ingress.https.issuerKindselects a namespaced cert-manager Issuer, and configured Ingress annotations override or remove (null) the chart's (feat(chart): support namespaced cert-manager Issuers #136, #)".pubgrade.ingress.https.issuerwith HTTPS on now fails (it rendered an empty annotation before), as in FOCA's chart; usenullinannotationsorhttps.enabled: falseinstead.Verification
tests/chart.sh(Helm 3.22.1): passed; new checks for both kinds,nullkind, HTTPS off, overrides andnullremoval for both kinds (values file and--set), a numeric issuer name, and the failure cases with their messages (other, empty and numeric kinds, empty issuer, both annotations). Written before the template change; they failed ondev.helm lint helm --strict: passed.pre-commit run --all-files(ruff, mypy, gitleaks, actionlint, file checks),shellcheck tests/chart.sh,mkdocs build --strict: passed.Reviews
Full lane (Helm chart). Round 1: adversarial (no high/medium; two lows fixed: issuer quoting, failure messages checked) and quality (two mediums fixed: header comment, missing Issuer-kind and message tests; low fixed: docs clause on empty issuer). Round 2: both no high/medium; one low (long digit-only issuer names from a values file become floats) handled by a note in
helm/values.yamlto quote such names.Declined review findings
0as issuer name failsrequired: declined;helm/values.yamlsays to quote digit-only names, and a quoted"0"renders (thread answered and resolved).Open questions
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5