From 8e65466f2d8540918b1fa8d8af88d0c21fcbf7f8 Mon Sep 17 00:00:00 2001 From: Matthew McGinn Date: Wed, 23 Sep 2020 15:23:33 -0400 Subject: [PATCH] version: drop SUPERVISOR_VERSION env var In order to make supervisor upgrades more transparent, lets move away from this env var since it requires a container restart any time the supervisor is upgraded. We should ultimately move towards providing the supervisors set of capabilities, but that can come later Connects-to: #1447 Change-type: major Signed-off-by: Matthew McGinn --- src/compose/service.ts | 1 - test/04-service.spec.ts | 2 -- test/23-contracts.spec.ts | 5 +++-- test/data/docker-states/entrypoint/inspect.json | 2 -- test/data/docker-states/network-mode-service/inspect.json | 2 -- test/data/docker-states/simple/inspect.json | 2 -- test/data/docker-states/supervisor-api/inspect.json | 2 -- 7 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/compose/service.ts b/src/compose/service.ts index ae8e9230..5b500f5c 100644 --- a/src/compose/service.ts +++ b/src/compose/service.ts @@ -966,7 +966,6 @@ export class Service { DEVICE_TYPE: options.deviceType, DEVICE_ARCH: options.deviceArch, HOST_OS_VERSION: options.osVersion, - SUPERVISOR_VERSION: options.version, APP_LOCK_PATH: '/tmp/balena/updates.lock', }, (_val, key) => `${namespace}_${key}`, diff --git a/test/04-service.spec.ts b/test/04-service.spec.ts index 9bbd7b7c..a9534846 100644 --- a/test/04-service.spec.ts +++ b/test/04-service.spec.ts @@ -65,7 +65,6 @@ describe('compose/service', () => { RESIN_DEVICE_TYPE: 'raspberry-pi', RESIN_HOST_OS_VERSION: 'Resin OS 2.0.2', RESIN_SERVICE_NAME: 'serviceName', - RESIN_SUPERVISOR_VERSION: 'v1.0.0', RESIN_APP_LOCK_PATH: '/tmp/balena/updates.lock', RESIN_SERVICE_KILL_ME_PATH: '/tmp/balena/handover-complete', RESIN: '1', @@ -76,7 +75,6 @@ describe('compose/service', () => { BALENA_DEVICE_TYPE: 'raspberry-pi', BALENA_HOST_OS_VERSION: 'Resin OS 2.0.2', BALENA_SERVICE_NAME: 'serviceName', - BALENA_SUPERVISOR_VERSION: 'v1.0.0', BALENA_APP_LOCK_PATH: '/tmp/balena/updates.lock', BALENA_SERVICE_HANDOVER_COMPLETE_PATH: '/tmp/balena/handover-complete', BALENA: '1', diff --git a/test/23-contracts.spec.ts b/test/23-contracts.spec.ts index 592ef439..ffb58e19 100644 --- a/test/23-contracts.spec.ts +++ b/test/23-contracts.spec.ts @@ -16,7 +16,7 @@ import supervisorVersion = require('../src/lib/supervisor-version'); describe('Container contracts', () => { before(() => { intialiseContractRequirements({ - supervisorVersion: '11.0.0', + supervisorVersion, deviceType: 'intel-nuc', l4tVersion: '32.2', }); @@ -224,6 +224,7 @@ describe('Container contracts', () => { ) .to.have.property('valid') .that.equals(true); + expect( containerContractsFulfilled({ service: { @@ -442,7 +443,7 @@ describe('L4T version detection', () => { } seedExec(version); intialiseContractRequirements({ - supervisorVersion: '11.0.0', + supervisorVersion, deviceType: 'intel-nuc', l4tVersion: await osRelease.getL4tVersion(), }); diff --git a/test/data/docker-states/entrypoint/inspect.json b/test/data/docker-states/entrypoint/inspect.json index db660118..05e4efdc 100644 --- a/test/data/docker-states/entrypoint/inspect.json +++ b/test/data/docker-states/entrypoint/inspect.json @@ -148,7 +148,6 @@ "RESIN_DEVICE_ARCH=amd64", "RESIN_DEVICE_TYPE=raspberrypi3", "RESIN_HOST_OS_VERSION=Resin OS 2.13.6+rev1", - "RESIN_SUPERVISOR_VERSION=7.18.0", "RESIN_APP_LOCK_PATH=/tmp/balena/updates.lock", "RESIN_SERVICE_KILL_ME_PATH=/tmp/balena/handover-complete", "RESIN=1", @@ -159,7 +158,6 @@ "BALENA_DEVICE_ARCH=amd64", "BALENA_DEVICE_TYPE=raspberrypi3", "BALENA_HOST_OS_VERSION=Resin OS 2.13.6+rev1", - "BALENA_SUPERVISOR_VERSION=7.18.0", "BALENA_APP_LOCK_PATH=/tmp/balena/updates.lock", "BALENA_SERVICE_HANDOVER_COMPLETE_PATH=/tmp/balena/handover-complete", "BALENA=1", diff --git a/test/data/docker-states/network-mode-service/inspect.json b/test/data/docker-states/network-mode-service/inspect.json index b6f45cc6..4b846005 100644 --- a/test/data/docker-states/network-mode-service/inspect.json +++ b/test/data/docker-states/network-mode-service/inspect.json @@ -148,7 +148,6 @@ "RESIN_DEVICE_ARCH=amd64", "RESIN_DEVICE_TYPE=raspberrypi3", "RESIN_HOST_OS_VERSION=Resin OS 2.13.6+rev1", - "RESIN_SUPERVISOR_VERSION=7.16.6", "RESIN_APP_LOCK_PATH=/tmp/balena/updates.lock", "RESIN_SERVICE_KILL_ME_PATH=/tmp/balena/handover-complete", "RESIN=1", @@ -159,7 +158,6 @@ "BALENA_DEVICE_ARCH=amd64", "BALENA_DEVICE_TYPE=raspberrypi3", "BALENA_HOST_OS_VERSION=Resin OS 2.13.6+rev1", - "BALENA_SUPERVISOR_VERSION=7.16.6", "BALENA_APP_LOCK_PATH=/tmp/balena/updates.lock", "BALENA_SERVICE_HANDOVER_COMPLETE_PATH=/tmp/balena/handover-complete", "BALENA=1", diff --git a/test/data/docker-states/simple/inspect.json b/test/data/docker-states/simple/inspect.json index e8d03f26..97ba63f6 100644 --- a/test/data/docker-states/simple/inspect.json +++ b/test/data/docker-states/simple/inspect.json @@ -148,7 +148,6 @@ "RESIN_DEVICE_ARCH=amd64", "RESIN_DEVICE_TYPE=raspberrypi3", "RESIN_HOST_OS_VERSION=Resin OS 2.13.6+rev1", - "RESIN_SUPERVISOR_VERSION=7.16.6", "RESIN_APP_LOCK_PATH=/tmp/balena/updates.lock", "RESIN_SERVICE_KILL_ME_PATH=/tmp/balena/handover-complete", "RESIN=1", @@ -159,7 +158,6 @@ "BALENA_DEVICE_ARCH=amd64", "BALENA_DEVICE_TYPE=raspberrypi3", "BALENA_HOST_OS_VERSION=Resin OS 2.13.6+rev1", - "BALENA_SUPERVISOR_VERSION=7.16.6", "BALENA_APP_LOCK_PATH=/tmp/balena/updates.lock", "BALENA_SERVICE_HANDOVER_COMPLETE_PATH=/tmp/balena/handover-complete", "BALENA=1", diff --git a/test/data/docker-states/supervisor-api/inspect.json b/test/data/docker-states/supervisor-api/inspect.json index 289ef9e9..70c584b4 100644 --- a/test/data/docker-states/supervisor-api/inspect.json +++ b/test/data/docker-states/supervisor-api/inspect.json @@ -168,7 +168,6 @@ "BALENA_DEVICE_TYPE=raspberrypi4-64", "BALENA_DEVICE_ARCH=aarch64", "BALENA_HOST_OS_VERSION=balenaOS 2.48.0+rev1", - "BALENA_SUPERVISOR_VERSION=11.6.6", "BALENA_APP_LOCK_PATH=/tmp/balena/updates.lock", "BALENA=1", "RESIN_APP_ID=1623449", @@ -178,7 +177,6 @@ "RESIN_DEVICE_TYPE=raspberrypi4-64", "RESIN_DEVICE_ARCH=aarch64", "RESIN_HOST_OS_VERSION=balenaOS 2.48.0+rev1", - "RESIN_SUPERVISOR_VERSION=11.6.6", "RESIN_APP_LOCK_PATH=/tmp/balena/updates.lock", "RESIN=1", "RESIN_SERVICE_KILL_ME_PATH=/tmp/balena/handover-complete",