fix(core): Fix configuration initialization by accepting a config argument

This commit is contained in:
2024-11-05 21:31:15 +01:00
parent 7eb6bf794c
commit b5433e412f
8 changed files with 60 additions and 53 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/cloudly',
version: '4.3.2',
version: '4.3.3',
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
}

View File

@ -60,7 +60,8 @@ export class Cloudly {
private readyDeferred = new plugins.smartpromise.Deferred();
constructor() {
private configOptions: plugins.servezoneInterfaces.data.ICloudlyConfig;
constructor(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
this.cloudlyInfo = new CloudlyInfo(this);
this.config = new CloudlyConfig(this);
@ -90,7 +91,7 @@ export class Cloudly {
*/
public async start() {
// config
await this.config.init();
await this.config.init(this.configOptions);
// manageers
await this.authManager.start();

View File

@ -15,7 +15,7 @@ export class CloudlyConfig {
this.cloudlyRef = cloudlyRefArg;
}
public async init() {
public async init(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
this.appData =
await plugins.npmextra.AppData.createAndInit<plugins.servezoneInterfaces.data.ICloudlyConfig>(
{
@ -54,6 +54,7 @@ export class CloudlyConfig {
'environment',
'mongoDescriptor',
],
overwriteObject: configArg,
},
);