From 52a0cb9505bd7641a38633d4d2e240e166df63b0 Mon Sep 17 00:00:00 2001 From: Paulius Date: Tue, 17 May 2022 09:32:10 +0100 Subject: [PATCH 1/2] BUGFIX: fix ipfs properties. --- app/ipfs.js | 4 ++-- app/server.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/ipfs.js b/app/ipfs.js index 4a69c65..056a087 100644 --- a/app/ipfs.js +++ b/app/ipfs.js @@ -86,8 +86,8 @@ async function setupIpfs() { async function ipfsHealthCheack(api, name = 'ipfs') { try { - if (!api || !api.pid) throw new ConnectionError({ name }) - const { spawnfile, pid, killed } = api + if (!api.ipfs || !api.ipfs.pid) throw new ConnectionError({ name }) + const { spawnfile, pid, killed } = api.ipfs return { name, diff --git a/app/server.js b/app/server.js index 9d1042a..e200a55 100644 --- a/app/server.js +++ b/app/server.js @@ -14,8 +14,7 @@ async function createHttpServer() { const sw = new ServiceWatcher({ substrate: { healthCheck: () => nodeHealthCheck({ isReady: false }) }, - // TODO temporary commenting out so I can investigate the health helch foor ipfs - // ipfs: { healthCheck: () => ipfsHealthCheack(ipfs) }, + ipfs: { healthCheck: () => ipfsHealthCheack(ipfs) }, }) await setupKeyWatcher({ From fc4a7bb3623c5d46cb560ed48aef387e02a7fb32 Mon Sep 17 00:00:00 2001 From: Paulius Date: Tue, 17 May 2022 09:44:38 +0100 Subject: [PATCH 2/2] BUGFIX: version bump --- app/ipfs.js | 2 +- app/server.js | 1 + helm/dscp-ipfs/Chart.yaml | 4 ++-- helm/dscp-ipfs/values.yaml | 2 +- package-lock.json | 2 +- package.json | 2 +- test/__fixtures__/ipfs-api-fn.js | 8 +++++--- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/ipfs.js b/app/ipfs.js index 056a087..7ddac40 100644 --- a/app/ipfs.js +++ b/app/ipfs.js @@ -84,7 +84,7 @@ async function setupIpfs() { return that } -async function ipfsHealthCheack(api, name = 'ipfs') { +async function ipfsHealthCheack(api = {}, name = 'ipfs') { try { if (!api.ipfs || !api.ipfs.pid) throw new ConnectionError({ name }) const { spawnfile, pid, killed } = api.ipfs diff --git a/app/server.js b/app/server.js index e200a55..429fa30 100644 --- a/app/server.js +++ b/app/server.js @@ -4,6 +4,7 @@ const pinoHttp = require('pino-http') const { PORT } = require('./env') const logger = require('./logger') const { setupKeyWatcher, nodeHealthCheck } = require('./keyWatcher') +const { ipfsHealthCheack } = require('./ipfs') const { setupIpfs } = require('./ipfs') const ServiceWatcher = require('./utils/ServiceWatcher') diff --git a/helm/dscp-ipfs/Chart.yaml b/helm/dscp-ipfs/Chart.yaml index 5270203..120bfec 100644 --- a/helm/dscp-ipfs/Chart.yaml +++ b/helm/dscp-ipfs/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: dscp-ipfs -appVersion: '2.1.1' +appVersion: '2.1.2' description: A Helm chart for dscp-ipfs -version: '2.1.1' +version: '2.1.2' type: application dependencies: - name: dscp-node diff --git a/helm/dscp-ipfs/values.yaml b/helm/dscp-ipfs/values.yaml index 55514c9..aac6875 100644 --- a/helm/dscp-ipfs/values.yaml +++ b/helm/dscp-ipfs/values.yaml @@ -37,7 +37,7 @@ config: image: repository: ghcr.io/digicatapult/dscp-ipfs pullPolicy: IfNotPresent - tag: 'v2.1.1' + tag: 'v2.1.2' storage: storageClass: "" diff --git a/package-lock.json b/package-lock.json index 97f299f..4f37db8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@digicatapult/dscp-ipfs", - "version": "2.1.1", + "version": "2.1.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index eca0853..3885ae3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@digicatapult/dscp-ipfs", - "version": "2.1.1", + "version": "2.1.2", "description": "Service for WASP", "main": "app/index.js", "scripts": { diff --git a/test/__fixtures__/ipfs-api-fn.js b/test/__fixtures__/ipfs-api-fn.js index 9f42427..e746bdd 100644 --- a/test/__fixtures__/ipfs-api-fn.js +++ b/test/__fixtures__/ipfs-api-fn.js @@ -2,9 +2,11 @@ const { ipfsHealthCheack } = require('../../app/ipfs'); module.exports = { available: { - pid: 10, - spawnfile: '/path/to/file/test/spawn.key', - killed: false, + ipfs: { + pid: 10, + spawnfile: '/path/to/file/test/spawn.key', + killed: false, + }, healthCheck: ipfsHealthCheack, } } \ No newline at end of file