mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 10:01:55 +00:00
feature: Add BALENA_API_URL
environment variable when using the balena-api
feature label
When using the label `io.balena.features.balena-api` the supervisor will inject 2 environment variables into the container: - BALENA_API_KEY - BALENA_API_URL This allows the container to access the currently associated API using the KEY. Change-type: patch Signed-off-by: Rich Bayliss <rich@balena.io> Connects-to: #847
This commit is contained in:
parent
50d2df73a1
commit
aeb96aa807
@ -188,6 +188,7 @@ export interface DeviceMetadata {
|
||||
version: string;
|
||||
deviceType: string;
|
||||
deviceApiKey: string;
|
||||
apiEndpoint: string;
|
||||
listenPort: number;
|
||||
apiSecret: string;
|
||||
supervisorApiHost: string;
|
||||
|
@ -357,6 +357,7 @@ export function addFeaturesFromLabels(
|
||||
|
||||
if (checkTruthy(service.config.labels['io.balena.features.balena-api'])) {
|
||||
setEnvVariables('API_KEY', options.deviceApiKey);
|
||||
setEnvVariables('API_URL', options.apiEndpoint);
|
||||
}
|
||||
|
||||
if (checkTruthy(service.config.labels['io.balena.features.supervisor-api'])) {
|
||||
|
@ -76,6 +76,7 @@ export const fnSchema = {
|
||||
'listenPort',
|
||||
'name',
|
||||
'apiSecret',
|
||||
'apiEndpoint',
|
||||
'deviceApiKey',
|
||||
'version',
|
||||
'deviceType',
|
||||
|
@ -218,6 +218,7 @@ export const schemaTypes = {
|
||||
name: t.string,
|
||||
apiSecret: t.union([t.string, NullOrUndefined]),
|
||||
deviceApiKey: t.string,
|
||||
apiEndpoint: t.string,
|
||||
version: t.string,
|
||||
deviceType: t.string,
|
||||
osVersion: t.union([t.string, NullOrUndefined]),
|
||||
|
Loading…
x
Reference in New Issue
Block a user