ui: Remove remaining partition FIXME comments (#11312)

This commit is contained in:
John Cowen 2021-10-19 12:31:30 +01:00 committed by GitHub
parent 99ab4f98d4
commit e938e0afe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 18 deletions

View File

@ -7,9 +7,8 @@ import { get } from '@ember/object';
// will give us all the intentions that have the `ns` as either the SourceNS or
// the DestinationNS.
// We currently list intentions by the * wildcard namespace for back compat reasons
// FIXME: Is now a good time to change this behaviour ^ ?
// TODO: Update to use this.formatDatacenter()
// TODO: Change the above so that we only list intentions with
// Source/Destination in the currently selected nspace
export default class IntentionAdapter extends Adapter {
requestForQuery(request, { dc, ns, partition, filter, index, uri }) {
return request`
@ -46,8 +45,6 @@ export default class IntentionAdapter extends Adapter {
DestinationName,
] = 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`
GET /v1/connect/intentions/exact?${{
source: `${SourcePartition}/${SourceNS}/${SourceName}`,
@ -82,8 +79,6 @@ export default class IntentionAdapter extends Adapter {
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`
PUT /v1/connect/intentions/exact?${{
source: `${data.SourcePartition}/${data.SourceNS}/${data.SourceName}`,
@ -99,14 +94,11 @@ export default class IntentionAdapter extends Adapter {
// you can no longer save Destinations
delete serialized.DestinationName;
delete serialized.DestinationNS;
// FIXME: Does the above comment stand for partitions also?
delete serialized.DestinationPartition;
return this.requestForCreateRecord(...arguments);
}
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`
DELETE /v1/connect/intentions/exact?${{
source: `${data.SourcePartition}/${data.SourceNS}/${data.SourceName}`,

View File

@ -80,7 +80,7 @@
@src={{uri '/${partition}/${nspace}/${dc}/oidc/providers'
(hash
partition=partition
nspace=(or nspace '')
nspace=nspace
dc=dc
)
}}
@ -102,11 +102,10 @@
{{/if}}
</div>
<State @matches="loading">
{{!FIXME: default partition?}}
<TokenSource
@dc={{dc}}
@nspace={{or value.Namespace nspace}}
@partition={{or value.Partition 'default'}}
@partition={{or value.Partition partition}}
@type={{if value.Name 'oidc' 'secret'}}
@value={{if value.Name value.Name value}}
@onchange={{queue (action dispatch "RESET") (action onsubmit)}}

View File

@ -8,7 +8,15 @@ export default class DiscoveryChain extends Model {
@attr('string') ServiceName;
@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() meta; // {}
}

View File

@ -11,7 +11,8 @@ export default class Proxy extends ServiceInstanceModel {
@attr('string') Datacenter;
@attr('string') Namespace;
// FIXME: Does this need a partition?
@attr('string') Partition;
@attr('string') ServiceName;
@attr('string') ServiceID;
@attr('string') NodeName;

View File

@ -233,7 +233,6 @@ export default class HttpService extends Service {
// 'default' which will mainly be used in OSS
[CONSUL_DATACENTER]: params.data.dc,
[CONSUL_NAMESPACE]: params.data.ns || token.Namespace || 'default',
// FIXME: Is the default partition '' or 'default'?
[CONSUL_PARTITION]: params.data.partition || token.Partition || 'default',
};
const respond = function(cb) {

View File

@ -33,7 +33,6 @@ export default class KvService extends RepositoryService {
// TODO: This very much shouldn't be here,
// needs to eventually use ember-datas generateId thing
// in the meantime at least our fingerprinter
// FIXME: Default/token partition
const uid = JSON.stringify([params.partition, params.ns, params.dc, params.id]);
item = this.store.peekRecord(this.getModelName(), uid);
if (!item) {

View File

@ -76,7 +76,6 @@ export default class PartitionRepository extends RepositoryService {
const items = this.store.peekAll(type).toArray();
if (currentName.length === 0) {
const token = await this.settings.findBySlug('token');
// FIXME: Is the default partition '' or 'default'?
currentName = token['Partition'] || 'default';
}
// if there is only 1 item then use that, otherwise find the