Repository navigation
feat: first version of aisix-controller - #1
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First version of the controller: it reconciles
ProviderKey,ModelandAPIKeycustom resources (aisix.api7.ai/v1alpha1) into the AISIX gateway's standalone resources file.How it works
resources.yaml. Credentials come from Secrets, caller keys are written as their SHA-256 hash,provider_key_refresolves to the ProviderKey's identity, and every$is escaped for${VAR}interpolation.aisix_core::filesource::load_from_str, the gateway's own pipeline. A rejected resource keeps its served version and reportsAccepted=False; the others still apply.aisix-resourcesSecret and stamps its hash on the Deployment's pod template, which rolls the gateway.Programmed=Trueonce the rollout lands.CRD schemas are generated from aisix-core's strict resource schemas (git dependency pinned to
v1.9.0) and converted to structural OpenAPI.make crdsregenerates them; a unit test and CI fail whendeploy/crdsis stale.Commits
Each step builds on its own with tests and clippy clean:
Testing
cargo test --locked: 27 unit tests pass.cargo clippy --all-targets -- -D warningsis clean.tests/e2e/run.sh: passes on kind with AISIX 1.9.0 from its Helm chart and a mock OpenAI upstream. It covers resources served end to end (including a$in a credential), an update reaching the gateway, CRD unknown-field rejection, a gateway-rejected change keeping the served version, a dangling reference, and API key revocation.Limitations
Listed in the README: every config change rolls the gateway pods (standalone AISIX reloads on SIGHUP only), one namespace and one controller replica, no admission webhook.