Skip to content

[WIP] interceptor: support for HTTP header routing #1289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wozniakjan
Copy link
Member

wip, credits to #1222

Checklist

Fixes #1177

@wozniakjan wozniakjan force-pushed the interceptor/header_based_routing branch 5 times, most recently from 8fa1e77 to 41ce412 Compare May 7, 2025 14:31
@wozniakjan wozniakjan force-pushed the interceptor/header_based_routing branch from 41ce412 to 199b19a Compare May 7, 2025 19:13
@wozniakjan wozniakjan requested a review from Copilot May 7, 2025 19:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds support for HTTP header routing in the interceptor, refactoring the tableMemory implementation and related utilities to leverage header-based matching.

  • Introduces a new RouteWithHeaders method to route based on HTTP header values.
  • Refactors tableMemory, httpSOIndex, and httpSOStore to support the new routing behavior.
  • Updates tests and CRD definitions to accommodate the header-based routing changes.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/routing/tablememory_test.go Updated tests to use the new helper (newTableMemory) and adjusted assertions for header routing behavior.
pkg/routing/tablememory.go Refactored tableMemory implementation and added the RouteWithHeaders method for header-based routing.
pkg/routing/table.go Updated routing logic to leverage RouteWithHeaders using the request headers.
pkg/routing/httpso_store_test.go Added tests to cover new and updated behaviors of httpSOStore.
pkg/routing/httpso_store.go Implemented helper functions for managing HTTPScaledObject lists with header considerations.
pkg/routing/httpso_index_test.go Updated tests for httpSOIndex functionality with inserted and deleted values.
pkg/routing/httpso_index.go Added helper functions for httpSOIndex to manage the index tree for HTTPScaledObject routing.
operator/apis/http/v1alpha1/httpscaledobject_types.go Added the new Header struct for header matching and updated CRD definitions accordingly.
config/crd/bases/http.keda.sh_httpscaledobjects.yaml Updated CRD documentation to include the new headers field.

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.

Http header routing pattern
1 participant