mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
* structs: CSIPlugin indexes jobs acting as plugins and node updates * schema: csi_plugins table for CSIPlugin * nomad: csi_endpoint use vol.Denormalize, plugin requests * nomad: csi_volume_endpoint: rename to csi_endpoint * agent: add CSI plugin endpoints * state_store_test: use generated ids to avoid t.Parallel conflicts * contributing: add note about registering new RPC structs * command: agent http register plugin lists * api: CSI plugin queries, ControllerHealthy -> ControllersHealthy * state_store: copy on write for volumes and plugins * structs: copy on write for volumes and plugins * state_store: CSIVolumeByID returns an unhealthy volume, denormalize * nomad: csi_endpoint use CSIVolumeDenormalizePlugins * structs: remove struct errors for missing objects * nomad: csi_endpoint return nil for missing objects, not errors * api: return meta from Register to avoid EOF error * state_store: CSIVolumeDenormalize keep allocs in their own maps * state_store: CSIVolumeDeregister error on missing volume * state_store: CSIVolumeRegister set indexes * nomad: csi_endpoint use CSIVolumeDenormalizePlugins tests
1.4 KiB
1.4 KiB
New RPC Endpoint Checklist
Prefer adding a new message to changing any existing RPC messages.
Code
Requeststruct and*RequestTypeconstant innomad/structs/structs.go. Append the constant, old constant values must remain unchanged- In
nomad/fsm.go, add a dispatch case to the switch statement in(n *nomadFSM) Apply*nomadFSMmethod to decode the request and call the state method
- State method for modifying objects in a
Txninnomad/state/state_store.gonomad/state/state_store_test.go
- Handler for the request in
nomad/foo_endpoint.go- RPCs are resolved by matching the method name for bound structs net/rpc
- Check ACLs for security, list endpoints filter by ACL
- Register new RPC struct in
nomad/server.go
- Wrapper for the HTTP request in
command/agent/foo_endpoint.go- Backwards compatibility requires a new endpoint, an upgraded client or server may be forwarding this request to an old server, without support for the new RPC
- RPCs triggered by an internal process may not need support
nomad/core_sched.gosends many RPCsServersMeetMinimumVersionasserts that the server cluster is upgraded, so use this to gaurd sending the new RPC, else send the old RPC- Version must match the actual release version!
Docs
- Changelog