Skip to content

Commit 739d9ec

Browse files
committed
feat(database-import): enhance user import logic with verification and error handling
1 parent f7fef4b commit 739d9ec

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

base/hub/kerberos-hub-import-database-job.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ data:
4545
4646
const ownerUsername = 'example-user';
4747
const applicationUsername = 'example-application';
48+
const organisationName = 'example-orgranisation';
4849
const zeroObjectId = ObjectId('000000000000000000000000');
4950
const ownerCreatedAt = ISODate('2016-09-20T09:27:58.811Z');
5051
const ownerUpdatedAt = ISODate('2020-06-14T05:01:35.000Z');
@@ -130,7 +131,7 @@ data:
130131
// The owner gets a random ObjectId on first import and is resolved by
131132
// username on reruns. Its organisation and default project share it.
132133
insertIfMissing('organisation', ownerId, {
133-
name: ownerUsername,
134+
name: organisationName,
134135
ownerId: ownerId,
135136
isActive: true,
136137
settings: {

modules/amazon-eks-documentdb/database-import/hub-import.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const database = db.getSiblingDB('Kerberos');
22
const ownerUsername = 'example-user';
33
const applicationUsername = 'example-application';
4+
const organisationName = 'example-orgranisation';
45
const zeroObjectId = ObjectId('000000000000000000000000');
56
const ownerCreatedAt = ISODate('2016-09-20T09:27:58.811Z');
67
const ownerUpdatedAt = ISODate('2020-06-14T05:01:35.000Z');
@@ -89,7 +90,7 @@ upsert('users', ownerId, {
8990
});
9091

9192
insertIfMissing('organisation', ownerId, {
92-
name: ownerUsername,
93+
name: organisationName,
9394
ownerId,
9495
isActive: true,
9596
settings: {

0 commit comments

Comments
 (0)