Skip to content

Conversation

@Pangjiping
Copy link
Collaborator

@Pangjiping Pangjiping commented Dec 26, 2025

Summary

  • add a component router for kubernetes ingress proxy.

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@Pangjiping Pangjiping force-pushed the feat/components/proxy branch from 5201f13 to b1e1026 Compare December 28, 2025 05:39
@Pangjiping Pangjiping marked this pull request as ready for review December 28, 2025 05:40
@Pangjiping Pangjiping force-pushed the feat/components/proxy branch from b1e1026 to 05bdeeb Compare December 28, 2025 05:42
@Pangjiping Pangjiping added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 28, 2025
@Pangjiping Pangjiping force-pushed the feat/components/proxy branch from 05bdeeb to 4ed09a0 Compare December 28, 2025 05:49
@jwx0925
Copy link
Collaborator

jwx0925 commented Dec 30, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 74 to 78
if code == http.StatusNotFound {
Logger.Warnw("Proxy: no pod found for ingress rule", "ingress", host.ingressKey)
}

http.Error(w, fmt.Sprintf("Proxy: %v", err), code)

Choose a reason for hiding this comment

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

P1 Badge Return after backend lookup errors

If fetchRealHost returns an error (no matching pod or multiple pods), the handler writes an error response but immediately continues to set the request host and call serve with the unresolved targetHost. The second proxy attempt can emit a new 502/500 and overwrite the earlier 404/409, making error responses flaky whenever the ingress lookup fails. Return after the http.Error so failed lookups do not continue into the proxy path.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nice suggestion, fixed.

Comment on lines 47 to 50
defer func() {
if err := recover(); err != nil {
Logger.Errorw("Proxy: proxy causes panic", "error", err)
http.Error(w, err.(error).Error(), http.StatusBadGateway)

Choose a reason for hiding this comment

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

P2 Badge Recover block re-panics on string panics

The recovery block assumes the panic value implements error and type-asserts err.(error) before responding. Panics triggered with plain strings (e.g., panic("boom") from helpers or libraries) will fail that assertion and crash the process instead of returning the intended 502 response, defeating the panic guard in those scenarios. Safeguard the type assertion or format the recovered value to avoid a secondary panic.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants