mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 06:07:57 +00:00
Merge pull request #826 from balena-io/local-mode-unmanaged-fixes
Local mode unmanaged fixes
This commit is contained in:
commit
d2fa9994df
@ -64,7 +64,7 @@ class Config extends EventEmitter {
|
||||
|
||||
// NOTE: all 'db' values are stored and loaded as *strings*,
|
||||
apiSecret: { source: 'db', mutable: true },
|
||||
name: { source: 'db', mutable: true },
|
||||
name: { source: 'db', mutable: true, default: 'local' },
|
||||
initialConfigReported: { source: 'db', mutable: true, default: 'false' },
|
||||
initialConfigSaved: { source: 'db', mutable: true, default: 'false' },
|
||||
containersNormalised: { source: 'db', mutable: true, default: 'false' },
|
||||
|
@ -13,7 +13,6 @@ module.exports = class DeviceConfig
|
||||
@rebootRequired = false
|
||||
@configKeys = {
|
||||
appUpdatePollInterval: { envVarName: 'SUPERVISOR_POLL_INTERVAL', varType: 'int', defaultValue: '60000' }
|
||||
localMode: { envVarName: 'SUPERVISOR_LOCAL_MODE', varType: 'bool', defaultValue: 'false' }
|
||||
connectivityCheckEnabled: { envVarName: 'SUPERVISOR_CONNECTIVITY_CHECK', varType: 'bool', defaultValue: 'true' }
|
||||
loggingEnabled: { envVarName: 'SUPERVISOR_LOG_CONTROL', varType: 'bool', defaultValue: 'true' }
|
||||
delta: { envVarName: 'SUPERVISOR_DELTA', varType: 'bool', defaultValue: 'false' }
|
||||
|
@ -19,8 +19,8 @@ DeviceConfig = require './device-config'
|
||||
ApplicationManager = require './application-manager'
|
||||
|
||||
validateLocalState = (state) ->
|
||||
if !state.name? or !validation.isValidShortText(state.name)
|
||||
throw new Error('Invalid device name')
|
||||
if state.name?
|
||||
throw new Error('Invalid device name') if not validation.isValidShortText(state.name)
|
||||
if !state.apps? or !validation.isValidAppsObject(state.apps)
|
||||
throw new Error('Invalid apps')
|
||||
if !state.config? or !validation.isValidEnv(state.config)
|
||||
|
@ -58,8 +58,8 @@ describe 'Config', ->
|
||||
expect(promise).to.eventually.deep.equal({ appUpdatePollInterval: 30000, name: 'a new device name' })
|
||||
|
||||
it 'allows removing a db key', ->
|
||||
promise = @conf.remove('name').then =>
|
||||
@conf.get('name')
|
||||
promise = @conf.remove('apiSecret').then =>
|
||||
@conf.get('apiSecret')
|
||||
expect(promise).to.be.fulfilled
|
||||
expect(promise).to.eventually.be.undefined
|
||||
|
||||
|
@ -21,7 +21,6 @@ mockedInitialConfig = {
|
||||
'RESIN_SUPERVISOR_DELTA_RETRY_COUNT': '30'
|
||||
'RESIN_SUPERVISOR_DELTA_RETRY_INTERVAL': '10000'
|
||||
'RESIN_SUPERVISOR_DELTA_VERSION': '2'
|
||||
'RESIN_SUPERVISOR_LOCAL_MODE': 'false'
|
||||
'RESIN_SUPERVISOR_LOG_CONTROL': 'true'
|
||||
'RESIN_SUPERVISOR_OVERRIDE_LOCK': 'false'
|
||||
'RESIN_SUPERVISOR_POLL_INTERVAL': '60000'
|
||||
@ -40,7 +39,6 @@ testTarget1 = {
|
||||
'SUPERVISOR_DELTA_RETRY_COUNT': '30'
|
||||
'SUPERVISOR_DELTA_RETRY_INTERVAL': '10000'
|
||||
'SUPERVISOR_DELTA_VERSION': '2'
|
||||
'SUPERVISOR_LOCAL_MODE': 'false'
|
||||
'SUPERVISOR_LOG_CONTROL': 'true'
|
||||
'SUPERVISOR_OVERRIDE_LOCK': 'false'
|
||||
'SUPERVISOR_POLL_INTERVAL': '60000'
|
||||
@ -122,7 +120,6 @@ testTargetWithDefaults2 = {
|
||||
'SUPERVISOR_DELTA_RETRY_COUNT': '30'
|
||||
'SUPERVISOR_DELTA_RETRY_INTERVAL': '10000'
|
||||
'SUPERVISOR_DELTA_VERSION': '2'
|
||||
'SUPERVISOR_LOCAL_MODE': 'false'
|
||||
'SUPERVISOR_LOG_CONTROL': 'true'
|
||||
'SUPERVISOR_OVERRIDE_LOCK': 'false'
|
||||
'SUPERVISOR_POLL_INTERVAL': '60000'
|
||||
|
Loading…
Reference in New Issue
Block a user