mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
parent
1b70b07c2b
commit
e264f61a50
@ -58,7 +58,7 @@ export const onedConfIncludesAction = (
|
||||
onedConf = {},
|
||||
action = 'monitor'
|
||||
) => {
|
||||
const isInZone = onedConf.FEDERATION?.ZONE_ID === marketplace.ZONE_ID
|
||||
const isInZone = (onedConf.FEDERATION?.ZONE_ID ?? '0') === marketplace.ZONE_ID
|
||||
const includesAction = onedConf.MARKET_MAD_CONF?.some(
|
||||
({ APP_ACTIONS, NAME }) =>
|
||||
APP_ACTIONS?.includes(action) &&
|
||||
|
@ -206,7 +206,7 @@ const importMarket = (res = {}, next = defaultEmptyFunction, params = {}) => {
|
||||
let rtn = httpBadRequest
|
||||
const { resource, id, marketId, associated, vmname } = params
|
||||
|
||||
if (id && ['vm', 'vm-template'].includes(params.resource)) {
|
||||
if (id && ['vm', 'vm-template'].includes(resource)) {
|
||||
let message = ''
|
||||
const paramsCommand = [resource, 'import', `${id}`]
|
||||
|
||||
|
@ -25,7 +25,7 @@ const {
|
||||
const {
|
||||
MARKETAPP_EXPORT,
|
||||
MARKETAPP_DOWNLOAD,
|
||||
MARKETAPP_VMIMPORT,
|
||||
MARKETAPP_IMPORT,
|
||||
MARKETAPP_DOCKERTAGS,
|
||||
} = Actions
|
||||
|
||||
@ -39,7 +39,7 @@ module.exports = [
|
||||
action: downloadApp,
|
||||
},
|
||||
{
|
||||
...Commands[MARKETAPP_VMIMPORT],
|
||||
...Commands[MARKETAPP_IMPORT],
|
||||
action: importMarket,
|
||||
},
|
||||
{
|
||||
|
@ -25,13 +25,13 @@ const { query, resource, postBody } = fromData
|
||||
const basepath = '/marketapp'
|
||||
const MARKETAPP_EXPORT = 'marketapp.export'
|
||||
const MARKETAPP_DOWNLOAD = 'marketapp.download'
|
||||
const MARKETAPP_VMIMPORT = 'marketapp.vmimport'
|
||||
const MARKETAPP_IMPORT = 'marketapp.import'
|
||||
const MARKETAPP_DOCKERTAGS = 'marketapp.dockertags'
|
||||
|
||||
const Actions = {
|
||||
MARKETAPP_EXPORT,
|
||||
MARKETAPP_DOWNLOAD,
|
||||
MARKETAPP_VMIMPORT,
|
||||
MARKETAPP_IMPORT,
|
||||
MARKETAPP_DOCKERTAGS,
|
||||
}
|
||||
|
||||
@ -82,8 +82,8 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
},
|
||||
[MARKETAPP_VMIMPORT]: {
|
||||
path: `${basepath}/vmimport/:vmId`,
|
||||
[MARKETAPP_IMPORT]: {
|
||||
path: `${basepath}/vmimport/:id`,
|
||||
httpMethod: POST,
|
||||
auth: true,
|
||||
params: {
|
||||
@ -91,7 +91,7 @@ module.exports = {
|
||||
from: resource,
|
||||
},
|
||||
resource: {
|
||||
from: resource,
|
||||
from: postBody,
|
||||
},
|
||||
associated: {
|
||||
from: postBody,
|
||||
|
@ -35,6 +35,7 @@ const ALLOWED_KEYS_ONED_CONF = [
|
||||
'VN_MAD_CONF',
|
||||
'IM_MAD',
|
||||
'AUTH_MAD',
|
||||
'FEDERATION',
|
||||
]
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user