Merge "fix: disable associate action when fip has port forwardings"

This commit is contained in:
Zuul 2022-07-18 08:19:47 +00:00 committed by Gerrit Code Review
commit b12700a63f

View File

@ -28,7 +28,10 @@ import globalFloatingIpsStore from 'stores/neutron/floatingIp';
import { PortStore } from 'stores/neutron/port'; import { PortStore } from 'stores/neutron/port';
import { instanceSelectTablePropsBackend } from 'resources/nova/instance'; import { instanceSelectTablePropsBackend } from 'resources/nova/instance';
import { getPortFormItem, getPortsAndReasons } from 'resources/neutron/port'; import { getPortFormItem, getPortsAndReasons } from 'resources/neutron/port';
import { getInterfaceWithReason } from 'resources/neutron/floatingip'; import {
getInterfaceWithReason,
disableFIPAssociate,
} from 'resources/neutron/floatingip';
export class Associate extends ModalAction { export class Associate extends ModalAction {
static id = 'associate'; static id = 'associate';
@ -180,7 +183,8 @@ export class Associate extends ModalAction {
static allowed = (item) => static allowed = (item) =>
Promise.resolve( Promise.resolve(
isNull(item.fixed_ip_address) && !disableFIPAssociate(item) &&
isNull(item.fixed_ip_address) &&
item.status === 'DOWN' && item.status === 'DOWN' &&
isNull(item.port_details) isNull(item.port_details)
); );