mirror of
https://github.com/status-im/consul.git
synced 2025-02-18 16:46:36 +00:00
This commit addresses some left over admin partition FIXMEs 1. Adds Partition correctly to Service Instances 2. Converts non-important 'we can do this later' FIXMEs to TODOs 3. Removes some FIXMEs that I've double checked and addressed. Most of the remaining FIXMEs I'm waiting on responses to questions from the consul core folks for. I'll address those in a separate PR.
28 lines
807 B
JavaScript
28 lines
807 B
JavaScript
import Adapter from './application';
|
|
|
|
// Blocking query support for partitions is currently disabled
|
|
export default class PartitionAdapter extends Adapter {
|
|
async requestForQuery(request, { ns, dc, index }) {
|
|
const respond = await request`
|
|
GET /v1/partitions?${{ dc }}
|
|
|
|
${{ index }}
|
|
`;
|
|
await respond((headers, body) => delete headers['x-consul-index']);
|
|
return respond;
|
|
}
|
|
// TODO: Not used until we do Partition CRUD
|
|
async requestForQueryRecord(request, { ns, dc, index, id }) {
|
|
if (typeof id === 'undefined') {
|
|
throw new Error('You must specify an id');
|
|
}
|
|
const respond = await request`
|
|
GET /v1/partition/${id}?${{ dc }}
|
|
|
|
${{ index }}
|
|
`;
|
|
await respond((headers, body) => delete headers['x-consul-index']);
|
|
return respond;
|
|
}
|
|
}
|