File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
src/utils/components/PolicyForm/PolicyWizard/utils/hooks/useNodeInterfaces/utils Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1+ import { InterfaceType } from '@kubevirt-ui/kubevirt-api/nmstate' ;
2+
3+ export const GENEV_INTERFACE_PREFIX = 'genev_' ;
4+
5+ export const bridgeTypes = [
6+ InterfaceType . OVS_BRIDGE ,
7+ InterfaceType . LINUX_BRIDGE ,
8+ InterfaceType . BOND ,
9+ ] ;
Original file line number Diff line number Diff line change 77} from '@kubevirt-ui/kubevirt-api/nmstate' ;
88import { getInterfaces } from '@utils/resources/nns/getters' ;
99import { getEthernetInterfaces } from '@utils/resources/nns/utils' ;
10-
11- const bridgeTypes = [ InterfaceType . OVS_BRIDGE , InterfaceType . LINUX_BRIDGE , InterfaceType . BOND ] ;
10+ import { bridgeTypes , GENEV_INTERFACE_PREFIX } from './constants' ;
1211
1312export const getExistingInterfaceNames = ( nodeNetworkStates : V1beta1NodeNetworkState [ ] ) => {
1413 const uniqueInterfaceNames = nodeNetworkStates . reduce ( ( acc , nns ) => {
@@ -35,7 +34,10 @@ const getUsedPortNamesForNode = (nns: V1beta1NodeNetworkState) => {
3534export const getAvailableInterfacesForNode = ( nns : V1beta1NodeNetworkState ) => {
3635 const usedPortNames = getUsedPortNamesForNode ( nns ) ;
3736 const allEthernetInterfaces = getEthernetInterfaces ( nns ) ;
38- return allEthernetInterfaces ?. filter ( ( iface ) => usedPortNames . includes ( iface ?. name ) ) ;
37+ return allEthernetInterfaces ?. filter (
38+ ( iface ) =>
39+ ! usedPortNames . includes ( iface ?. name ) && ! iface ?. name ?. startsWith ( GENEV_INTERFACE_PREFIX ) ,
40+ ) ;
3941} ;
4042
4143const nnsInterfaceComparator = (
You can’t perform that action at this time.
0 commit comments