chore: update cloudly dependency stack
Align Cloudly with the current typedserver, smartconfig, smartstate, and Docker tooling releases so builds and Docker output stay compatible with the upgraded stack.
This commit is contained in:
@@ -9,7 +9,7 @@ export class CloudlyNodeManager {
|
||||
public typedRouter = new plugins.typedrequest.TypedRouter();
|
||||
public curlfreshInstance = new CurlFresh(this);
|
||||
|
||||
public hetznerAccount: plugins.hetznercloud.HetznerAccount;
|
||||
public hetznerAccount?: plugins.hetznercloud.HetznerAccount;
|
||||
|
||||
public get db() {
|
||||
return this.cloudlyRef.mongodbConnector.smartdataDb;
|
||||
@@ -65,13 +65,17 @@ export class CloudlyNodeManager {
|
||||
console.log(`Skipping node provisioning for cluster ${cluster.id} - setupMode is ${cluster.data.setupMode || 'manual'}`);
|
||||
continue;
|
||||
}
|
||||
const hetznerAccount = this.hetznerAccount;
|
||||
if (!hetznerAccount) {
|
||||
throw new Error('Hetzner account is not configured');
|
||||
}
|
||||
|
||||
// get existing nodes
|
||||
const nodes = await this.getNodesByCluster(cluster);
|
||||
|
||||
// if there is no node, create one
|
||||
if (nodes.length === 0) {
|
||||
const hetznerServer = await this.hetznerAccount.createServer({
|
||||
const hetznerServer = await hetznerAccount.createServer({
|
||||
name: plugins.smartunique.uniSimple('node'),
|
||||
location: 'nbg1',
|
||||
type: 'cpx41',
|
||||
@@ -79,7 +83,7 @@ export class CloudlyNodeManager {
|
||||
clusterId: cluster.id,
|
||||
priority: '1',
|
||||
},
|
||||
userData: await this.curlfreshInstance.getServerUserData(),
|
||||
userData: await this.curlfreshInstance.getServerUserData(cluster),
|
||||
});
|
||||
|
||||
// First create BareMetal record
|
||||
@@ -94,12 +98,12 @@ export class CloudlyNodeManager {
|
||||
);
|
||||
// if there is a node, make sure that it exists
|
||||
for (const node of nodes) {
|
||||
const hetznerServers = await this.hetznerAccount.getServersByLabel({
|
||||
const hetznerServers = await hetznerAccount.getServersByLabel({
|
||||
clusterId: cluster.id,
|
||||
});
|
||||
if (!hetznerServers || hetznerServers.length === 0) {
|
||||
console.log(`node ${node.id} does not exist in the real world. Creating it now...`);
|
||||
const hetznerServer = await this.hetznerAccount.createServer({
|
||||
const hetznerServer = await hetznerAccount.createServer({
|
||||
name: plugins.smartunique.uniSimple('node'),
|
||||
location: 'nbg1',
|
||||
type: 'cpx41',
|
||||
@@ -107,6 +111,7 @@ export class CloudlyNodeManager {
|
||||
clusterId: cluster.id,
|
||||
priority: '1',
|
||||
},
|
||||
userData: await this.curlfreshInstance.getServerUserData(cluster),
|
||||
});
|
||||
|
||||
// First create BareMetal record
|
||||
|
||||
Reference in New Issue
Block a user