Skip to content

feat(chart): support namespaced Issuers - #820

Merged
uniqueg merged 5 commits into
devfrom
feat/811-namespaced-issuers
Nov 23, 2026
Merged

uniqueg merged 5 commits into
devfrom
feat/811-namespaced-issuers

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #811.

  • foca-common: new value <valuesKey>.ingress.https.issuerKind: ClusterIssuer (default; also when unset or null, so existing app charts render exactly as before) or Issuer, which sets cert-manager.io/issuer instead of cert-manager.io/cluster-issuer.
  • The values schema (app-values.schema.json and the petstore copy) accepts only ClusterIssuer, Issuer or null; without the schema, the template fails on other kinds. Rendering also fails if the final annotations name both a ClusterIssuer and an Issuer (cert-manager refuses such Ingresses).
  • Docs (docs/helm-chart.md, OpenShift section): the recipe for a namespaced Let's Encrypt Issuer with an HTTP-01 solver of class openshift-default, an Ingress with route.openshift.io/termination: edge, where router annotations go, and a second Ingress for a second host name. Deployment notes and petstore values.yaml updated; entry in the unreleased foca-common 0.6.0 notes (no version bump needed, 0.6.0 is unreleased).

Unblocks elixir-cloud-aai/Pubgrade#136.

Verification

  • pytest charts/foca-common/tests (Helm 3.22.1): 521 passed, incl. new tests for both kinds, the default with and without issuerKind, null with and without schema, schema rejection, schema-less invalid kinds, both annotations, issuerKind without HTTPS. Existing snapshots unchanged.
  • helm lint --strict of the library and the petstore chart with every ci/*-values.yaml: passed.
  • ruff check, ruff format --check, mypy, mkdocs build --strict: passed.
  • CI: pending.

Reviews

Two rounds of adversarial and quality review; all high and medium findings fixed (default path untested, null rejected by the schema), and the low ones (both annotations, null without default, second host name via Ingress instead of a hand-made Route, wording).

Declined review findings

  • Drop the template check of issuerKind and rely on the schema: kept, because app charts need not copy the schema or may have an older copy.

Open questions

None.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5

Summary by Sourcery

Enable Ingress certificates to use namespaced cert-manager Issuers while preserving existing ClusterIssuer behavior by default.

New Features:

  • Support selecting a namespaced cert-manager Issuer for Ingress certificates through the new issuerKind value, while retaining ClusterIssuer as the default.

Bug Fixes:

  • Reject unsupported issuer kinds and conflicting Issuer and ClusterIssuer annotations during chart rendering.

Enhancements:

  • Extend the values schemas and example configuration for issuer selection, including null/default handling.
  • Document the OpenShift setup for namespaced certificate issuance and additional hostnames.

Documentation:

  • Add OpenShift guidance for configuring namespaced cert-manager Issuers, HTTP-01 challenges, routes, and additional hostnames.

Tests:

  • Add coverage for issuer selection, defaults, schema validation, invalid values, conflicting annotations, and HTTPS-disabled configurations.

Chores:

  • Record the namespaced Issuer support in the unreleased chart release notes.

uniqueg and others added 4 commits November 23, 2026 01:41
Add <valuesKey>.ingress.https.issuerKind (ClusterIssuer by default,
or Issuer), which annotates the Ingress with cert-manager.io/issuer
instead of cert-manager.io/cluster-issuer, for clusters where
projects can't create cluster-scoped resources. The schema accepts
only the two kinds; without the schema, other kinds fail to render.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Describe issuerKind in the deployment notes and the release notes of
foca-common 0.6.0, and the OpenShift setup: an Ingress of the class
openshift-default with edge termination, a namespaced Let's Encrypt
Issuer with an HTTP-01 solver, and a Route for a second host name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Treat issuerKind: null like an unset kind, also in app charts
without a default, and fail if the Ingress's annotations name both a
ClusterIssuer and an Issuer, which cert-manager refuses. Document
where router annotations go and a second Ingress for a second host
name, so that cert-manager renews its certificate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
Allow null for issuerKind in the values schema, as the template treats
it as the default ClusterIssuer, and test it with and without the
schema. Rewrap the template comment and split the OpenShift notes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqN5w1v5t1QRTKU7ad5
@uniqueg uniqueg self-assigned this Nov 23, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Update the shared and example values schemas to accept issuerKind as ClusterIssuer, Issuer, or null, defining the supported Helm values interface.

  • charts/foca-common/app-values.schema.json L259-264
  • examples/petstore/chart/values.schema.json L259-264

Implementation

Update the Ingress helper to select the cert-manager issuer annotation, default and validate the issuer kind, reject conflicting issuer annotations, and document these behaviors in the template comment.

  • charts/foca-common/templates/_ingress.tpl L6-11, L22-31, L41-43

Configuration

Add the issuerKind default and explain how to configure a namespaced Issuer in the petstore example values.

  • examples/petstore/chart/values.yaml L119-128

Documentation

Document the OpenShift setup for namespaced Issuers, including the HTTP-01 solver, Ingress and Route annotations, and certificate handling for additional hostnames.

  • docs/helm-chart.md L493-553, L856-858

Record namespaced Issuer support and its configuration in the foca-common 0.6.0 release notes.

  • docs/releases/chart/0.6.0.md L1, L14

Tests

Add coverage for issuer selection and defaults, null values with and without schemas, invalid kinds, conflicting annotations, and behavior when HTTPS is disabled.

  • charts/foca-common/tests/test_templates.py L1356-1480

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@uniqueg uniqueg changed the title feat(chart): support namespaced cert-manager Issuers feat(chart): support namespaced Issuers Nov 23, 2026
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (515b2fd) to head (0670e96).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #820   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           76        76           
  Lines        10708     10708           
=========================================
  Hits         10708     10708           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 23, 2026 01:34
@sourcery-ai

sourcery-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 0670e96

#811 feat(chart): support namespaced cert-manager Issuers · 5 of 5 met

# Requirement Status Notes
1 Support ClusterIssuer by default and Issuer via issuerKind, using the corresponding cert-manager annotation. ✅ Met The template defaults to ClusterIssuer, treats null as the default, and selects the Issuer annotation when issuerKind is Issuer.
2 Test both issuer kinds and verify the default renders as before. ✅ Met Tests cover both annotation choices and retain a default-HTTPS assertion for the ClusterIssuer annotation and TLS output.
3 Restrict issuerKind in the values schema to the supported kinds. ✅ Met Both schemas allow ClusterIssuer or Issuer; null is also allowed to represent the default.
4 Document the OpenShift recipe, including the namespaced Issuer, class-matched HTTP-01 solver, edge-terminated Ingress, and preserving a second host outside the chart. ✅ Met The docs include the Issuer and Ingress examples and explain using a second external Ingress, which OpenShift turns into a Route, for another hostname.
5 Add a changelog entry. ✅ Met The foca-common 0.6.0 release notes describe namespaced Issuer support and issuerKind.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the issuer kind is selected incorrectly, cert-manager can request and serve the host certificate from an unintended issuer; reverting the chart does not automatically revoke certificates already issued, so they may need to be replaced or revoked.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit 5f6c105 into dev Nov 23, 2026
83 checks passed
@uniqueg
uniqueg deleted the feat/811-namespaced-issuers branch November 23, 2026 01:50
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.

feat(chart): support namespaced cert-manager Issuers

1 participant