Skip to content

fix: remove adapter mappings when ConfigMaps are deleted - #314

Open
git-jxj wants to merge 1 commit into
llm-d:mainfrom
git-jxj:fix/deleted-adapter-configmaps
Open

git-jxj wants to merge 1 commit into
llm-d:mainfrom
git-jxj:fix/deleted-adapter-configmaps

Conversation

@git-jxj

@git-jxj git-jxj commented Sep 5, 2026

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

Deleting a managed ConfigMap leaves its adapter mappings active: the reconciler receives NotFound and passes an empty ConfigMap to the store, which cannot identify the cached entry. Requests keep receiving the deleted base model in their routing header.

Preserve the reconcile key and cache each ConfigMap's base model so deletion can remove its mappings without reading the deleted object. Keep base-model reference counts consistent when a ConfigMap changes its base model.

Regression tests exercise reconciliation after deleting same-named ConfigMaps in different namespaces, verify the plugin's routing headers, and cover shared base models, repeated deletion, and base-model updates. Both new tests fail on the upstream baseline.

Validation: make test (including race detection and integration tests), make lint (0 issues), and git diff --check.

Also ran the deletion lifecycle against a real Kubernetes 1.35 API server and etcd using a temporary envtest fixture. On unmodified main, both deleted adapters and the last base model still produce a routing header. The same check passes with the fix. This validates reconciliation and plugin output; it is not a deployed gateway end-to-end test.

Which issue(s) this PR fixes:

Found through code review.

Release note (write NONE if no user-facing change):

The base-model extractor removes stale routing mappings when managed ConfigMaps are deleted and updates base-model reference counts when their configuration changes.

Signed-off-by: git-jxj <xinjun.jiang@daocloud.io>
@github-actions github-actions Bot added kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 5, 2026
@git-jxj

git-jxj commented Sep 11, 2026

Copy link
Copy Markdown
Author

The GitHub Actions runs for current head 43881d2bb6d4 are waiting for maintainer approval (action_required), including Run Jobs on PR, Label non-main PRs (and 2 other workflows). Could a maintainer approve the pending workflow runs so CI can validate this head?

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

Labels

kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant