From 851ee880b40469c4d7a7b4e184b66001ee3a585a Mon Sep 17 00:00:00 2001 From: Julie Date: Fri, 24 Nov 2023 16:33:24 +0100 Subject: [PATCH] Add NMstate skeleton to BMC form --- .../lib/cim/components/Agent/BMCForm.tsx | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/libs/ui-lib/lib/cim/components/Agent/BMCForm.tsx b/libs/ui-lib/lib/cim/components/Agent/BMCForm.tsx index 3562910ad8..28d76fe28f 100644 --- a/libs/ui-lib/lib/cim/components/Agent/BMCForm.tsx +++ b/libs/ui-lib/lib/cim/components/Agent/BMCForm.tsx @@ -184,7 +184,26 @@ const emptyValues: AddBmcValues = { bootMACAddress: '', disableCertificateVerification: true, // TODO(mlibra) online: true, - nmState: '', + nmState: + 'interfaces:\n\ +- name: \n\ + type: ethernet\n\ + state: up\n\ + ipv4:\n\ + address:\n\ + - ip: \n\ + prefix-length: 24\n\ + enabled: true\n\ +dns-resolver:\n\ + config:\n\ + server:\n\ + - \n\ +routes:\n\ + config:\n\ + - destination: 0.0.0.0/0\n\ + next-hop-address: \n\ + next-hop-interface: \n\ +', macMapping: [{ macAddress: '', name: '' }], }; @@ -204,7 +223,7 @@ const getInitValues = ( bootMACAddress: bmh?.spec?.bootMACAddress || '', disableCertificateVerification: !!bmh?.spec?.bmc?.disableCertificateVerification, online: !!bmh?.spec?.online, - nmState: nmState ? yaml.dump(nmState?.spec?.config) : '', + nmState: nmState ? yaml.dump(nmState?.spec?.config) : emptyValues.nmState, macMapping: nmState?.spec?.interfaces || [{ macAddress: '', name: '' }], }; } else {