Skip to content

Commit

Permalink
Add NMstate skeleton to BMC form (#2464)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgyselov authored Jan 5, 2024
1 parent 1827b88 commit 24c83af
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions libs/ui-lib/lib/cim/components/Agent/BMCForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,26 @@ const emptyValues: AddBmcValues = {
bootMACAddress: '',
disableCertificateVerification: true, // TODO(mlibra)
online: true,
nmState: '',
nmState:
'interfaces:\n\
- name: <nic1_name>\n\
type: ethernet\n\
state: up\n\
ipv4:\n\
address:\n\
- ip: <ip_address>\n\
prefix-length: 24\n\
enabled: true\n\
dns-resolver:\n\
config:\n\
server:\n\
- <dns_ip_address>\n\
routes:\n\
config:\n\
- destination: 0.0.0.0/0\n\
next-hop-address: <next_hop_ip_address>\n\
next-hop-interface: <next_hop_nic1_name>\n\
',
macMapping: [{ macAddress: '', name: '' }],
};

Expand All @@ -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 {
Expand Down

0 comments on commit 24c83af

Please sign in to comment.