Skip to content

Commit

Permalink
controller: removes sink implementation (#364)
Browse files Browse the repository at this point in the history
**Commit Message**

This removes the config sink style implementation of controller.
Previously, there the config sink was used as a central place to do the
mutation that involves multiple resources. However, it unnecessarily
comes with the complexity and this simplifies the implementation by
removing it.

Majority of the changes are code moving, especially moving the resource
mutation code from sink to under AIGatewayRoute controller.

This was brought up in the conversation with @sanposhiho and more follow
up PRs will come to polish the implementation.

---------

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
  • Loading branch information
mathetake authored Feb 18, 2025
1 parent 5fe5e59 commit 702370d
Show file tree
Hide file tree
Showing 19 changed files with 2,016 additions and 1,854 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ linters-settings:
alias: mcsapiv1a1
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
alias: $1$2
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
- pkg: github.com/envoyproxy/ai-gateway/internal/testing
alias: internaltesting
gci:
sections:
# Captures all standard packages if they do not match another section.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HELM_CHART_VERSION ?= v0.0.0-latest

# Arguments for go test. This can be used, for example, to run specific tests via
# `GO_TEST_ARGS="-run TestName/foo/etc -v -race"`.
GO_TEST_ARGS ?= -v -race
GO_TEST_ARGS ?= -race
# Arguments for go test in e2e tests in addition to GO_TEST_ARGS, applicable to test-e2e, test-extproc, and test-controller.
GO_TEST_E2E_ARGS ?= -count=1

Expand Down Expand Up @@ -151,7 +151,7 @@ test-extproc: build.extproc
@$(MAKE) build.extproc_custom_router CMD_PATH_PREFIX=examples
@$(MAKE) build.testupstream CMD_PATH_PREFIX=tests/internal/testupstreamlib
@echo "Run ExtProc test"
@go test ./tests/extproc/... $(GO_TEST_ARGS) $(GO_TEST_E2E_ARGS) -tags test_extproc -v
@go test ./tests/extproc/... $(GO_TEST_ARGS) $(GO_TEST_E2E_ARGS) -tags test_extproc

# This runs the end-to-end tests for the controller with EnvTest.
.PHONY: test-controller
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ require (
k8s.io/apiextensions-apiserver v0.32.2
k8s.io/apimachinery v0.32.2
k8s.io/client-go v0.32.2
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20241210054802-24370beab758
sigs.k8s.io/controller-runtime v0.20.2
sigs.k8s.io/gateway-api v1.2.1
Expand Down Expand Up @@ -374,6 +373,7 @@ require (
k8s.io/apiserver v0.32.2 // indirect
k8s.io/cli-runtime v0.32.1 // indirect
k8s.io/component-base v0.32.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect
k8s.io/kubectl v0.32.1 // indirect
mvdan.cc/gofumpt v0.7.0 // indirect
Expand Down
Loading

0 comments on commit 702370d

Please sign in to comment.