ui: Remove remaining partition FIXME comments (#11312)
This commit is contained in:
parent
97dda48b74
commit
9535ab2987
|
@ -7,9 +7,8 @@ import { get } from '@ember/object';
|
||||||
// will give us all the intentions that have the `ns` as either the SourceNS or
|
// will give us all the intentions that have the `ns` as either the SourceNS or
|
||||||
// the DestinationNS.
|
// the DestinationNS.
|
||||||
// We currently list intentions by the * wildcard namespace for back compat reasons
|
// We currently list intentions by the * wildcard namespace for back compat reasons
|
||||||
// FIXME: Is now a good time to change this behaviour ^ ?
|
// TODO: Change the above so that we only list intentions with
|
||||||
|
// Source/Destination in the currently selected nspace
|
||||||
// TODO: Update to use this.formatDatacenter()
|
|
||||||
export default class IntentionAdapter extends Adapter {
|
export default class IntentionAdapter extends Adapter {
|
||||||
requestForQuery(request, { dc, ns, partition, filter, index, uri }) {
|
requestForQuery(request, { dc, ns, partition, filter, index, uri }) {
|
||||||
return request`
|
return request`
|
||||||
|
@ -46,8 +45,6 @@ export default class IntentionAdapter extends Adapter {
|
||||||
DestinationName,
|
DestinationName,
|
||||||
] = id.split(':').map(decodeURIComponent);
|
] = id.split(':').map(decodeURIComponent);
|
||||||
|
|
||||||
// FIXME: Service and Namespace are encoded into the URL here
|
|
||||||
// guessing we need to do the same thing for Partitions
|
|
||||||
return request`
|
return request`
|
||||||
GET /v1/connect/intentions/exact?${{
|
GET /v1/connect/intentions/exact?${{
|
||||||
source: `${SourcePartition}/${SourceNS}/${SourceName}`,
|
source: `${SourcePartition}/${SourceNS}/${SourceName}`,
|
||||||
|
@ -82,8 +79,6 @@ export default class IntentionAdapter extends Adapter {
|
||||||
body.Permissions = serialized.Permissions;
|
body.Permissions = serialized.Permissions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// FIXME: Service and Namespace are encoded into the URL here
|
|
||||||
// guessing we need to do the same thing for Partitions
|
|
||||||
return request`
|
return request`
|
||||||
PUT /v1/connect/intentions/exact?${{
|
PUT /v1/connect/intentions/exact?${{
|
||||||
source: `${data.SourcePartition}/${data.SourceNS}/${data.SourceName}`,
|
source: `${data.SourcePartition}/${data.SourceNS}/${data.SourceName}`,
|
||||||
|
@ -99,14 +94,11 @@ export default class IntentionAdapter extends Adapter {
|
||||||
// you can no longer save Destinations
|
// you can no longer save Destinations
|
||||||
delete serialized.DestinationName;
|
delete serialized.DestinationName;
|
||||||
delete serialized.DestinationNS;
|
delete serialized.DestinationNS;
|
||||||
// FIXME: Does the above comment stand for partitions also?
|
|
||||||
delete serialized.DestinationPartition;
|
delete serialized.DestinationPartition;
|
||||||
return this.requestForCreateRecord(...arguments);
|
return this.requestForCreateRecord(...arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
requestForDeleteRecord(request, serialized, data) {
|
requestForDeleteRecord(request, serialized, data) {
|
||||||
// FIXME: Service and Namespace are encoded into the URL here
|
|
||||||
// guessing we need to do the same thing for Partitions
|
|
||||||
return request`
|
return request`
|
||||||
DELETE /v1/connect/intentions/exact?${{
|
DELETE /v1/connect/intentions/exact?${{
|
||||||
source: `${data.SourcePartition}/${data.SourceNS}/${data.SourceName}`,
|
source: `${data.SourcePartition}/${data.SourceNS}/${data.SourceName}`,
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
@src={{uri '/${partition}/${nspace}/${dc}/oidc/providers'
|
@src={{uri '/${partition}/${nspace}/${dc}/oidc/providers'
|
||||||
(hash
|
(hash
|
||||||
partition=partition
|
partition=partition
|
||||||
nspace=(or nspace '')
|
nspace=nspace
|
||||||
dc=dc
|
dc=dc
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
@ -102,11 +102,10 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<State @matches="loading">
|
<State @matches="loading">
|
||||||
{{!FIXME: default partition?}}
|
|
||||||
<TokenSource
|
<TokenSource
|
||||||
@dc={{dc}}
|
@dc={{dc}}
|
||||||
@nspace={{or value.Namespace nspace}}
|
@nspace={{or value.Namespace nspace}}
|
||||||
@partition={{or value.Partition 'default'}}
|
@partition={{or value.Partition partition}}
|
||||||
@type={{if value.Name 'oidc' 'secret'}}
|
@type={{if value.Name 'oidc' 'secret'}}
|
||||||
@value={{if value.Name value.Name value}}
|
@value={{if value.Name value.Name value}}
|
||||||
@onchange={{queue (action dispatch "RESET") (action onsubmit)}}
|
@onchange={{queue (action dispatch "RESET") (action onsubmit)}}
|
||||||
|
|
|
@ -8,7 +8,15 @@ export default class DiscoveryChain extends Model {
|
||||||
@attr('string') ServiceName;
|
@attr('string') ServiceName;
|
||||||
|
|
||||||
@attr('string') Datacenter;
|
@attr('string') Datacenter;
|
||||||
// FIXME: Does this need partition?
|
// Whilst the disco chain itself is scoped to a ns/partition we generally only
|
||||||
|
// use data from within the disco chain itself when displaying data (i.e. the
|
||||||
|
// configs themselves) We also use the API response JSON for fingerprinting
|
||||||
|
// already. All in-all these properties are mainly here for consistency rather
|
||||||
|
// than need as of writing in case any assumptions are made expecting disco
|
||||||
|
// chain root Partition/Namespace
|
||||||
|
@attr('string') Partition;
|
||||||
|
@attr('string') Namespace;
|
||||||
|
//
|
||||||
@attr() Chain; // {}
|
@attr() Chain; // {}
|
||||||
@attr() meta; // {}
|
@attr() meta; // {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,8 @@ export default class Proxy extends ServiceInstanceModel {
|
||||||
|
|
||||||
@attr('string') Datacenter;
|
@attr('string') Datacenter;
|
||||||
@attr('string') Namespace;
|
@attr('string') Namespace;
|
||||||
// FIXME: Does this need a partition?
|
@attr('string') Partition;
|
||||||
|
|
||||||
@attr('string') ServiceName;
|
@attr('string') ServiceName;
|
||||||
@attr('string') ServiceID;
|
@attr('string') ServiceID;
|
||||||
@attr('string') NodeName;
|
@attr('string') NodeName;
|
||||||
|
|
|
@ -233,7 +233,6 @@ export default class HttpService extends Service {
|
||||||
// 'default' which will mainly be used in OSS
|
// 'default' which will mainly be used in OSS
|
||||||
[CONSUL_DATACENTER]: params.data.dc,
|
[CONSUL_DATACENTER]: params.data.dc,
|
||||||
[CONSUL_NAMESPACE]: params.data.ns || token.Namespace || 'default',
|
[CONSUL_NAMESPACE]: params.data.ns || token.Namespace || 'default',
|
||||||
// FIXME: Is the default partition '' or 'default'?
|
|
||||||
[CONSUL_PARTITION]: params.data.partition || token.Partition || 'default',
|
[CONSUL_PARTITION]: params.data.partition || token.Partition || 'default',
|
||||||
};
|
};
|
||||||
const respond = function(cb) {
|
const respond = function(cb) {
|
||||||
|
|
|
@ -33,7 +33,6 @@ export default class KvService extends RepositoryService {
|
||||||
// TODO: This very much shouldn't be here,
|
// TODO: This very much shouldn't be here,
|
||||||
// needs to eventually use ember-datas generateId thing
|
// needs to eventually use ember-datas generateId thing
|
||||||
// in the meantime at least our fingerprinter
|
// in the meantime at least our fingerprinter
|
||||||
// FIXME: Default/token partition
|
|
||||||
const uid = JSON.stringify([params.partition, params.ns, params.dc, params.id]);
|
const uid = JSON.stringify([params.partition, params.ns, params.dc, params.id]);
|
||||||
item = this.store.peekRecord(this.getModelName(), uid);
|
item = this.store.peekRecord(this.getModelName(), uid);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
|
|
|
@ -76,7 +76,6 @@ export default class PartitionRepository extends RepositoryService {
|
||||||
const items = this.store.peekAll(type).toArray();
|
const items = this.store.peekAll(type).toArray();
|
||||||
if (currentName.length === 0) {
|
if (currentName.length === 0) {
|
||||||
const token = await this.settings.findBySlug('token');
|
const token = await this.settings.findBySlug('token');
|
||||||
// FIXME: Is the default partition '' or 'default'?
|
|
||||||
currentName = token['Partition'] || 'default';
|
currentName = token['Partition'] || 'default';
|
||||||
}
|
}
|
||||||
// if there is only 1 item then use that, otherwise find the
|
// if there is only 1 item then use that, otherwise find the
|
||||||
|
|
Loading…
Reference in New Issue