Skip to content
Snippets Groups Projects

Enable export and import of SDN configuration

Merged Ghost User requested to merge export-import-sdn-config into develop
1 file
+ 10
2
Compare changes
  • Side-by-side
  • Inline
@@ -26,8 +26,16 @@ func (n *Node) FillAllFields(containerRegistryURL string) {
// Works if linux and our gnmi target is used.
softwareVersion := n.YangData.System.State.SoftwareVersion
if softwareVersion != nil {
n.Kind = "linux"
n.Image = containerRegistryURL + *softwareVersion
// Checks if software version is in compatible format.
result, _ := regexp.MatchString(`^([A-Za-z0-9\.\/])*:([A-Za-z0-9\.])*`, *softwareVersion)
if result {
n.Kind = "linux"
n.Image = containerRegistryURL + *softwareVersion
return
}
n.Kind = "couldn't detect kind"
n.Image = "couldn't detect image"
return
}
Loading