mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-20 17:33:18 +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;
|
||||
uuid?: string;
|
||||
registered_at?: number;
|
||||
|
||||
os?: {
|
||||
sshKeys?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export function generateBaseConfig(
|
||||
@ -54,6 +58,9 @@ export function generateBaseConfig(
|
||||
version: string;
|
||||
appUpdatePollInterval?: number;
|
||||
deviceType?: string;
|
||||
os?: {
|
||||
sshKeys?: string[];
|
||||
}
|
||||
},
|
||||
): Promise<ImgConfig> {
|
||||
options = {
|
||||
@ -68,6 +75,15 @@ export function generateBaseConfig(
|
||||
return promise.tap(config => {
|
||||
// os.getConfig always returns a config for an app
|
||||
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