feat(discovery): simplify agent registration and publication#1586
Conversation
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
7 similar comments
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
|
/build_test |
|
Workflow started at 6/9/2026, 5:47:50 PM. View Actions Run. |
|
CI build: |
|
CI build: |
|
The CI job for checking/updating API schemas is currently busted, so please update that manually by running |
f983076 to
20fb164
Compare
20fb164 to
610a28a
Compare
|
/build_test |
|
Workflow started at 6/10/2026, 10:45:10 AM. View Actions Run. |
|
CI build: |
|
@jtolentino1 rebase and merge conflict resolution needed |
e6b5004 to
9a82c00
Compare
|
/build_test |
|
Workflow started at 6/15/2026, 3:29:07 PM. View Actions Run. |
|
CI build: |
|
CI build: |
Welcome to Cryostat! 👋
Before contributing, make sure you have:
mainbranch[chore, ci, docs, feat, fix, test]To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/mainFixes: #1494
Companion PRs: cryostatio/cryostat-agent#909, cryostatio/cryostat-operator#1349
Description of the change:
This change adds a new Agent-specific endpoint
POST /api/v4.3/discovery/agentsthat combines Discovery Plugin registration, Stored Credential creation/association, and discovery node publication into a single request handled in one transaction. The response is the samePluginRegistrationshape (id,token,env) as the existing registration endpoint.Targetrecords on theconnectUrlunique constraint. This applies to both the new endpoint and the existingPOST /api/v4.2/discovery/{id}publication path, which shares the same implementation.DiscoveryPluginnow supports a directly-associated credential at persist time, so Agent callbacks no longer need to embedstoredcredentials:<id>userinfo for Cryostat to authenticate its pings.DiscoveryPluginTestcoverage for the new endpoint: registration with credential storage and publication, deregistration cleanup, and idempotent re-registration with credential replacement.Motivation for the change:
See #1494. The Cryostat Agent is the only known external Discovery Plugin implementation, and its registration currently requires a sequence of separate requests (credential query/creation, plugin registration, publication) with corresponding state tracking on the Agent side. Combining these into one Agent-specific request reduces the number of API calls and database transactions, lets the Agent's internal state shrink to just its webserver credentials and plugin ID/token, and removes the need for the Agent to track and clean up Stored Credentials. The Agent-side counterpart is cryostatio/cryostat-agent#909, and cryostatio/cryostat-operator#1349 tightens the operator's Agent proxy accordingly.
How to manually test:
idandtoken:idwith a newtoken, the realm still contains exactly oneagent-node(no duplicates), and the credential from step 3 has been replaced by a new one (old ID gone from/api/v4/credentials).POST /api/v4.3/discovery/agents, makes no/api/v4/credentialsrequests, re-registers cleanly after its token expires, and deregisters with credential cleanup on shutdown.