Skip to content

Fix middleware reference conditions in Traefik IngressRoute#31

Merged
akiyashkin-ronasit merged 2 commits intotraefik-ingressfrom
copilot/sub-pr-29-again
Dec 18, 2025
Merged

Fix middleware reference conditions in Traefik IngressRoute#31
akiyashkin-ronasit merged 2 commits intotraefik-ingressfrom
copilot/sub-pr-29-again

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

The IngressRoute unconditionally referenced optional middlewares that are only created when specific configuration keys exist, causing deployment failures when those keys are missing.

Changes

  • IngressRoute middleware references: Added hasKey guards for optional middlewares (ipAllowList, buffering, noindex) to match their creation conditions
  • noindex middleware creation: Changed condition from .Values.ingress to .Values.ingress.enabled for consistency with other middlewares

Example

Before:

middlewares:
  - name: {{ include "laravel.fullname" $ }}-forwarded-headers
  {{- if $.Values.ingress.ipAllowList.enabled }}
  - name: {{ include "laravel.fullname" $ }}-ip-allowlist
  {{- end }}

After:

middlewares:
  - name: {{ include "laravel.fullname" $ }}-forwarded-headers
  {{- if and (hasKey $.Values.ingress "ipAllowList") $.Values.ingress.ipAllowList.enabled }}
  - name: {{ include "laravel.fullname" $ }}-ip-allowlist
  {{- end }}

Middleware references now align with their creation conditions, preventing references to non-existent resources.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: akiyashkin-ronasit <162979216+akiyashkin-ronasit@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 18, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • charts.bitnami.com
    • Triggering command: /usr/local/bin/helm helm repo add bitnami REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] WIP addressing feedback on Traefik Ingress implementation Fix middleware reference conditions in Traefik IngressRoute Dec 18, 2025
Copy link
Contributor

@akiyashkin-ronasit akiyashkin-ronasit left a comment

Choose a reason for hiding this comment

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

looks good

@akiyashkin-ronasit akiyashkin-ronasit marked this pull request as ready for review December 18, 2025 08:54
@akiyashkin-ronasit akiyashkin-ronasit merged commit c6b5149 into traefik-ingress Dec 18, 2025
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.

2 participants