Skip to content

Commit 277e9d8

Browse files
committed
Rename the supervisor service to core on the commposition
This will allow it to show on the dashboard with that name in the Supervisor services table. Change-type: minor
1 parent d6b4624 commit 277e9d8

2 files changed

Lines changed: 16 additions & 34 deletions

File tree

docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
version: '2.3'
22

33
services:
4-
# This service can only be named `main` or `balena-supervisor` as older
5-
# devices will keep relying on the `/v6/supervisor_release` endpoint that
6-
# identifies the supervisor image by that service name.
7-
balena-supervisor:
4+
# This service can only be named `main`, `balena-supervisor` or `core`
5+
# in a multi-container supervisor, the API `supervisor_release` needs to be able to
6+
# identify the "main" supervisor image so the `update-balena-supervisor` script works
7+
# properly
8+
core:
89
build: ./
910
privileged: true
1011
tty: true

src/lib/supervisor-metadata.ts

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
export type SupervisorMetadata = {
22
uuid: string;
3-
serviceName: string;
43
};
54

5+
const SUPERVISOR_SVC_NAMES = ['main', 'balena-supervisor', 'core'];
6+
67
/**
78
* Although it might feel unsettling to hardcode these ids here.
89
* the main purpose of app uuids is to have environment independent
@@ -13,31 +14,16 @@ export type SupervisorMetadata = {
1314
* This will only be necessary until the supervisor becomes an actual app
1415
* on balena
1516
*/
16-
const SUPERVISOR_APPS: { [arch: string]: SupervisorMetadata } = {
17-
amd64: {
18-
uuid: '52e35121417640b1b28a680504e4039b',
19-
serviceName: 'balena-supervisor',
20-
},
21-
aarch64: {
22-
uuid: '900de4f3cbac4b9bbd232885a35e407b',
23-
serviceName: 'balena-supervisor',
24-
},
25-
armv7hf: {
26-
uuid: '2e66a95795c149959c69472a8c2f92b8',
27-
serviceName: 'balena-supervisor',
28-
},
29-
i386: {
30-
uuid: '531b357e155c480cbec0fdd33041a1f5',
31-
serviceName: 'balena-supervisor',
32-
},
33-
rpi: {
34-
uuid: '6822565f766e413e96d9bebe2227cdcc',
35-
serviceName: 'balena-supervisor',
36-
},
17+
const SUPERVISOR_APPS: { [arch: string]: string } = {
18+
amd64: '52e35121417640b1b28a680504e4039b',
19+
aarch64: '900de4f3cbac4b9bbd232885a35e407b',
20+
armv7hf: '2e66a95795c149959c69472a8c2f92b8',
21+
i386: '531b357e155c480cbec0fdd33041a1f5',
22+
rpi: '6822565f766e413e96d9bebe2227cdcc',
3723
};
3824

3925
export function isSupervisorApp(appUuid: string): boolean {
40-
return Object.values(SUPERVISOR_APPS).some(({ uuid }) => uuid === appUuid);
26+
return Object.values(SUPERVISOR_APPS).some((uuid) => uuid === appUuid);
4127
}
4228

4329
/**
@@ -49,13 +35,8 @@ export function isSupervisorApp(appUuid: string): boolean {
4935
*
5036
* TODO: remove this once the supervisor knows how to update itself
5137
*/
52-
5338
export const isSupervisor = (appUuid: string, svcName: string) => {
54-
return (
55-
Object.values(SUPERVISOR_APPS).filter(
56-
({ uuid, serviceName }) =>
57-
// Compare with `main` as well for compatibility with older supervisors
58-
appUuid === uuid && (svcName === serviceName || svcName === 'main'),
59-
).length > 0
39+
return Object.values(SUPERVISOR_APPS).some(
40+
(uuid) => appUuid === uuid && SUPERVISOR_SVC_NAMES.includes(svcName),
6041
);
6142
};

0 commit comments

Comments
 (0)