-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(nms): improve sync of orc8r tenants with NMS organizations in NMS scripts #13939
fix(nms): improve sync of orc8r tenants with NMS organizations in NMS scripts #13939
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
4141424
to
311a244
Compare
20afbee
to
a1bcde2
Compare
a1bcde2
to
990d750
Compare
nms/scripts/createOrganization.ts
Outdated
@@ -13,8 +13,13 @@ | |||
|
|||
import Sequelize from 'sequelize'; | |||
|
|||
import axios from 'axios'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'axios' is defined but never used.
nms/scripts/setPassword.ts
Outdated
@@ -12,11 +12,13 @@ | |||
*/ | |||
|
|||
import Sequelize from 'sequelize'; | |||
import axios from 'axios'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'axios' is defined but never used.
Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
… if organization is created or updated Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
…ts with NMS orgs Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com>
Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
60212d2
to
f398fed
Compare
f398fed
to
31d2a64
Compare
nms/server/util/tenantsSync.ts
Outdated
|
||
import OrchestratorAPI from '../api/OrchestratorAPI'; | ||
import axios from 'axios'; | ||
import {Organization} from '../../shared/sequelize_models'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'Organization' is defined but never used.
nms/server/util/tenantsSync.ts
Outdated
import axios from 'axios'; | ||
import {Organization} from '../../shared/sequelize_models'; | ||
import {OrganizationModel} from '../../shared/sequelize_models/models/organization'; | ||
import {Tenant} from '../../generated'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'Tenant' is defined but never used.
nms/server/util/tenantsSync.ts
Outdated
import {Organization} from '../../shared/sequelize_models'; | ||
import {OrganizationModel} from '../../shared/sequelize_models/models/organization'; | ||
import {Tenant} from '../../generated'; | ||
import {isEqual, sortBy} from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'isEqual' is defined but never used.
nms/server/util/tenantsSync.ts
Outdated
import {Organization} from '../../shared/sequelize_models'; | ||
import {OrganizationModel} from '../../shared/sequelize_models/models/organization'; | ||
import {Tenant} from '../../generated'; | ||
import {isEqual, sortBy} from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unused-vars> reported by reviewdog 🐶
'sortBy' is defined but never used.
Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
31d2a64
to
39685cd
Compare
… scripts (magma#13939) * refactor tenants sync functions in util file Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com> * adapt scripts that are run by dev_setup.sh to sync with orc8r as well if organization is created or updated Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com> * add modified version of syncTenants to utils, which syncs orc8r tenants with NMS orgs Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com> * add initial sync of orc8r tenants Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com> * Minor changes and fix mock server for e2e test Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com> * Revert initial tenants-sync when creating organization Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com> Signed-off-by: Alexander zur Bonsen <alexander.zur.bonsen@tngtech.com> Signed-off-by: Sebastian Thomas <sebastian.thomas@tngtech.com> Co-authored-by: Sebastian Thomas <sebastian.thomas@tngtech.com>
Summary
[merge after #13917 (and rebase before)]
This PR follows up on #13917 and implements corresponding changes in scripts that create or modify organizations.
These scripts are called when
dev_setup.sh
is run after NMS start up.In
createOrganization.ts
an initial sync is introduced, which updates orc8r tenants to the state of NMS organizations.Test Plan
locally test that
dev_setup.sh
(i.e. createOrganization.ts) is rundev_setup.sh
are also created or updated in orc8r "tenants" tableAdditional Information