Repository navigation
fix(chart): drop ingress-nginx defaults - #440
Merged
Merged
Conversation
foca-common sets no defaults for a particular ingress controller: - The Ingress no longer adds nginx.ingress.kubernetes.io/proxy-body-size from the app's size limit; controller annotations are opt-in via ingress.annotations. The limit is still checked (now in foca-common.validate, also without an Ingress), and the maxContentLength setting and helper stay for app charts' resources. - The schema allows an empty networkPolicy.ingressFrom (as a default), with a neutral description; the template still fails if the policy is enabled without peers, and its message links to the docs. The petstore example defaults to [] instead of the ingress-nginx namespace. - route.enabled (true if not set, as in 0.1.0 values) turns off the OpenShift Route, e.g., for a Route or HTTPRoute of the app's own. - Neutral keep-alive and body-size descriptions in schema and values. Tests cover the new defaults, opt-in annotations, the helper, the Route toggle and empty peers; snapshots updated. Refs #436 Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Exposing the app" says that the chart has no controller defaults and gets a "NetworkPolicy peers" section (Envoy Gateway, Traefik on k3s, ingress-nginx, OpenShift, clients in the namespace; from Cloud Registry's chart docs), which the per-setup guides and the petstore values link to, so that app charts can link instead of copying. The ingress-nginx guide shows the opt-in body-size, TLS-redirect and rate limit annotations; the OpenShift guide and deployment notes describe route.enabled. The 0.17 migration guide gets "No ingress-nginx defaults" for foca-common 0.1.0 -> 0.2.0. Refs #436 Co-Authored-By: Claude Opus 5.5 <[email protected]>
From review: a commented peer for implementations that run a Gateway's proxies in its namespace (e.g., Istio, via the Gateway API label), a note that the list is not exhaustive, and rewrapped NOTES and Traefik paragraphs. Refs #436 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThis PR removes foca-common’s ingress-nginx and namespace-specific defaults, making ingress annotations and NetworkPolicy peers opt-in while retaining content-length validation and helper compatibility; it adds backward-compatible OpenShift Route control, updates the petstore example and schemas, and centralizes the operational and migration guidance in documentation with comprehensive test and snapshot updates. Sequence diagram for content-length validation and opt-in ingress annotationssequenceDiagram
participant Helm as Helm rendering
participant Validate as foca-common.validate
participant Ingress as foca-common.ingress
participant Values as App values
Helm->>Validate: maxContentLength
Validate-->>Helm: validate positive integer
Helm->>Ingress: render Ingress
Ingress->>Values: ingress.annotations
Values-->>Ingress: controller-specific annotations
Ingress-->>Helm: Ingress without controller defaults
Flow diagram for OpenShift Route selectionflowchart TD
A[Render exposure resources] --> B{Ingress or HTTPRoute enabled?}
B -->|Yes| C[Do not create OpenShift Route]
B -->|No| D{route.enabled is false?}
D -->|Yes| C
D -->|No or unset| E{Route API available?}
E -->|Yes| F[Create OpenShift Route for all paths]
E -->|No| C
Flow diagram for NetworkPolicy peer validationflowchart TD
A[NetworkPolicy enabled] --> B[Read ingressFrom]
B --> C{At least one peer?}
C -->|No: null or empty list| D[Fail rendering and link to NetworkPolicy peer docs]
C -->|Yes| E[Render NetworkPolicy with supplied peers]
F[NetworkPolicy disabled] --> G[Do not render NetworkPolicy]
File-Level Changes
Possibly linked issues
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 #440 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 2869 2869
=========================================
Hits 2869 2869
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
October 23, 2026 14:50
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
foca-common (0.2.0, unreleased) no longer has defaults for a particular ingress controller. ingress-nginx is retired, and apps had copied these defaults (cloud-registry#196).
nginx.ingress.kubernetes.io/proxy-body-sizefrom the app's size limit. Controller annotations are opt-in through<valuesKey>.ingress.annotations, and the docs give a body-size example per controller.config.server.max_content_lengthis a positive integer still runs. It moved intofoca-common.validate, so it now runs without an Ingress too.maxContentLengthsetting and thefoca-common.maxContentLengthhelper stay, because cloud-registry and proTES set the setting. App charts can use the helper in their own resources.ingressFromdescription is neutral.minItems, so[]works as a default.[]with a documented placeholder comment, instead of theingress-nginxnamespace.<valuesKey>.route.enabled(camelCase,truein the petstore values) turns off the Route, which serves all paths, e.g., when the app brings its own Route or HTTPRoute. Values without the key, as in 0.1.0, keep the Route (dig ... true). The petstore NOTES mention the new value.docs/helm-chart.md:docs/migration-0.17.md: new section "No ingress-nginx defaults" for foca-common 0.1.0 → 0.2.0.How it was verified
pytest charts/foca-common/tests(Helm v3.22.1, as in CI): 203 passed. New and changed tests cover:route.enabled: false, and values withoutroute.enabled;route.enabled;[]andnullall failing when the policy is enabled;The snapshots
ingress-https(annotation gone) andhttp-route(explicit peers) are updated.helm lint --strict charts/foca-commonandhelm lint --strict examples/petstore/chart -f ci/<each>.yaml: passed.pre-commit run --all-files: passed.mypy: passed.mkdocs build --strict: passed. The anchors#networkpolicy-peersand#no-ingress-nginx-defaultsresolve.ci/gateway-values.yamlalready sets its own peers, and kind has no Route API.Declined review findings
maxContentLengthsetting and helper (quality, low): apps already set the setting, and the helper costs nothing. Keeping both avoids a break, and the docs say what they are for.latest(both, low): the values already link tolatestdocs the same way, and the anchor is new and meant to stay stable.Open questions
None.
Closes #436
🤖 Generated with Claude Code
Summary by Sourcery
Remove ingress-nginx-specific defaults from the common Helm chart and make ingress, NetworkPolicy, and OpenShift Route configuration explicitly opt-in or setup-specific.
New Features:
<valuesKey>.route.enabledsetting to control automatic OpenShift Route creation.Bug Fixes:
Enhancements:
Documentation:
Tests: