refactor: split browser and auth-proxy ingresses. - #586
Conversation
|
Claude finished @pantierra's task in 3m 46s —— View job Claude's PR Review
✅ No blocking issues — safe to merge. Traced the full flow: Note: I could not execute No correctness, security, or best-practice issues found in the diff. Simplify (ponytail)
Both are minor style nits, not blocking. 💰 Estimated review cost: $1.27 · 3m46s · 32 turns |
b2068f8 to
652a443
Compare
0c5165d to
c4bb6ea
Compare
c4bb6ea to
364dceb
Compare
364dceb to
81e90d4
Compare
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| path: /stac | ||
| - equal: | ||
| path: metadata.annotations["nginx.ingress.kubernetes.io/rewrite-target"] | ||
| value: /$2 |
There was a problem hiding this comment.
It seems that these notContains assertions can never fail without any: true
The assertion seems to pass even when the path is present, and fails correctly once any: true is added.
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: Prefix | ||
| path: /stac | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-stac-auth-proxy | ||
| port: | ||
| number: 8080 | ||
| - contains: | ||
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: ImplementationSpecific | ||
| path: /browser(/|$)(.*) | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-browser | ||
| port: | ||
| number: 8080 | ||
| path: /browser |
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: Prefix | ||
| path: /stac | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-stac-auth-proxy | ||
| port: | ||
| number: 8080 | ||
| - contains: | ||
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| pathType: ImplementationSpecific | ||
| path: /browser(/|$)(.*) | ||
| backend: | ||
| service: | ||
| name: RELEASE-NAME-browser | ||
| port: | ||
| number: 8080 | ||
| path: /browser |
There was a problem hiding this comment.
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| pathType: Prefix | |
| path: /stac | |
| backend: | |
| service: | |
| name: RELEASE-NAME-stac-auth-proxy | |
| port: | |
| number: 8080 | |
| - contains: | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| pathType: ImplementationSpecific | |
| path: /browser(/|$)(.*) | |
| backend: | |
| service: | |
| name: RELEASE-NAME-browser | |
| port: | |
| number: 8080 | |
| path: /browser | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /browser | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /browser(/|$)(.*) | |
| any: true |
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| path: "/browser" |
There was a problem hiding this comment.
Sane issue than https://github.com/developmentseed/eoapi-k8s/pull/586/changes#r3675257745
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: "/browser" | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: "/browser" | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: "/browser(/|$)(.*)" | |
| any: true |
| - notContains: | ||
| path: spec.rules[0].http.paths | ||
| content: | ||
| path: /stac |
There was a problem hiding this comment.
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac | |
| any: true | |
| - notContains: | |
| path: spec.rules[0].http.paths | |
| content: | |
| path: /stac(/|$)(.*) | |
| any: true |
| {{- $_ := set $annotations "traefik.ingress.kubernetes.io/router.entrypoints" ($root.Values.ingress.entrypoints | toString) -}} | ||
| {{- end -}} | ||
| {{- $annotations = mergeOverwrite $annotations ($root.Values.ingress.annotations | default dict) -}} | ||
| {{- $annotations = mergeOverwrite $annotations $owned -}} |
There was a problem hiding this comment.
While testing this branch with Claude it noticed that a user supplied traefik.ingress.kubernetes.io/router.middlewares in ingress.annotations can get silently dropped
To reproduce:
helm template eoapi charts/eoapi \
--set ingress.className=traefik \
--set browser.enabled=true --set raster.enabled=true \
--set 'ingress.annotations.traefik\.ingress\.kubernetes\.io/router\.middlewares=default-forward-auth@kubernetescrd'
| Ingress | router.middlewares value rendered |
|---|---|
| eoapi-browser-ingress | default-eoapi-browser-redirect-middleware@kubernetescrd |
| eoapi-ingress (main) | default-eoapi-strip-prefix-middleware@kubernetescrd |
default-forward-auth@kubernetescrd, the value set isn't in either one. It's not appended or merged, just replaced, with no warning 😬
Would it make sense to append instead of overwrite? e.g. in eoapi.ingressCommonAnnotations, just before the final merge:
{{- $mwKey := "traefik.ingress.kubernetes.io/router.middlewares" -}}
{{- if and (hasKey $annotations $mwKey) (hasKey $owned $mwKey) -}}
{{- $_ := set $owned $mwKey (printf "%s,%s" (get $annotations $mwKey) (get $owned $mwKey)) -}}
{{- end -}}
With that change, the same command renders:
| Ingress | router.middlewares value rendered |
|---|---|
| eoapi-browser-ingress | default-forward-auth@kubernetescrd,default-eoapi-browser-redirect-middleware@kubernetescrd |
| eoapi-ingress (main) | default-forward-auth@kubernetescrd,defauleware@kubernetescrd |
what do you think?
Closes #568.