mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-21 17:56:57 +00:00
Add os.sshKeys to generateBaseConfig
Change-type: minor
This commit is contained in:
parent
6c26e1235c
commit
9eae9dcee3
@ -46,6 +46,10 @@ interface ImgConfig {
|
|||||||
deviceId?: number;
|
deviceId?: number;
|
||||||
uuid?: string;
|
uuid?: string;
|
||||||
registered_at?: number;
|
registered_at?: number;
|
||||||
|
|
||||||
|
os?: {
|
||||||
|
sshKeys?: string[];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function generateBaseConfig(
|
export function generateBaseConfig(
|
||||||
@ -54,6 +58,9 @@ export function generateBaseConfig(
|
|||||||
version: string;
|
version: string;
|
||||||
appUpdatePollInterval?: number;
|
appUpdatePollInterval?: number;
|
||||||
deviceType?: string;
|
deviceType?: string;
|
||||||
|
os?: {
|
||||||
|
sshKeys?: string[];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
): Promise<ImgConfig> {
|
): Promise<ImgConfig> {
|
||||||
options = {
|
options = {
|
||||||
@ -68,6 +75,15 @@ export function generateBaseConfig(
|
|||||||
return promise.tap(config => {
|
return promise.tap(config => {
|
||||||
// os.getConfig always returns a config for an app
|
// os.getConfig always returns a config for an app
|
||||||
delete config.apiKey;
|
delete config.apiKey;
|
||||||
|
|
||||||
|
// merge sshKeys to config, when they have been specified
|
||||||
|
if(options.os && options.os.sshKeys) {
|
||||||
|
// Create config.os object if it does not exist
|
||||||
|
config.os = config.os ? config.os : {};
|
||||||
|
config.os.sshKeys = config.os.sshKeys
|
||||||
|
? [...config.os.sshKeys, ...options.os.sshKeys]
|
||||||
|
: options.os.sshKeys;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user