From 9a2cb560940d90cc6e43dc21693bab8bc08f23da Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Tue, 18 Jan 2022 18:10:27 +0100 Subject: [PATCH] fix(core): update --- test/test.cloudly.ts | 16 ++++++++++++++++ ts/connector.cloudly/cloudlyconnector.ts | 5 +++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 test/test.cloudly.ts diff --git a/test/test.cloudly.ts b/test/test.cloudly.ts new file mode 100644 index 0000000..feac4fc --- /dev/null +++ b/test/test.cloudly.ts @@ -0,0 +1,16 @@ +process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = '0'; +import { tap, expect } from '@pushrocks/tapbundle'; + +import * as cloudlyConnectorMod from '../ts/connector.cloudly/cloudlyconnector'; + +tap.test('should be able to announce a container to cloudly', async () => { + const cloudlyConnector = new cloudlyConnectorMod.CloudlyConnector(null); + await cloudlyConnector.announceDockerContainer({ + registryUrl: 'registry.losssless.com', + tag: 'testcontainer', + version: 'x.x.x', + labels: [] + }, 'cloudly.lossless.one') +}); + +tap.start(); \ No newline at end of file diff --git a/ts/connector.cloudly/cloudlyconnector.ts b/ts/connector.cloudly/cloudlyconnector.ts index 760b8b7..5753830 100644 --- a/ts/connector.cloudly/cloudlyconnector.ts +++ b/ts/connector.cloudly/cloudlyconnector.ts @@ -14,9 +14,10 @@ export class CloudlyConnector { } public async announceDockerContainer( - optionsArg: plugins.tsclass.container.IContainer + optionsArg: plugins.tsclass.container.IContainer, + testCloudlyUrlArg?: string ) { - const cloudlyUrl = this.npmciRef.npmciConfig.getConfig().urlCloudly; + const cloudlyUrl = testCloudlyUrlArg || this.npmciRef.npmciConfig.getConfig().urlCloudly; if (!cloudlyUrl) { logger.log( 'warn',