diff --git a/app/ipfs.js b/app/ipfs.js index 4a69c65..7ddac40 100644 --- a/app/ipfs.js +++ b/app/ipfs.js @@ -84,10 +84,10 @@ async function setupIpfs() { return that } -async function ipfsHealthCheack(api, name = 'ipfs') { +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..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') @@ -14,8 +15,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({ 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