Skip to content

Commit 1d248ed

Browse files
pkeerthanashaleman
pkeerthana
authored andcommittedApr 25, 2016
infranw: fixed model backward compatibility (#17)
* infranw: fixed model backward compatibility * fix typo error * Updated comments - default value for nwType
1 parent bb05161 commit 1d248ed

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎contivModel.go

+4
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,10 @@ func ValidateNetwork(obj *Network) error {
18741874
return errors.New("networkName string too long")
18751875
}
18761876

1877+
if obj.NwType == "" {
1878+
obj.NwType = "data"
1879+
}
1880+
18771881
nwTypeMatch := regexp.MustCompile("^(infra|data)$")
18781882
if nwTypeMatch.MatchString(obj.NwType) == false {
18791883
return errors.New("nwType string invalid format")

‎network.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"nwType": {
2121
"type": "string",
2222
"format": "^(infra|data)$",
23+
"default": "\"data\"",
2324
"title": "Network Type",
2425
"showSummary": true
2526
},

0 commit comments

Comments
 (0)
Please sign in to comment.