This repository was archived by the owner on May 12, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 1.11.0-rc0
1+ 1.11.0
Original file line number Diff line number Diff line change @@ -959,6 +959,13 @@ func TestCheckVersionConsistencyInComponents(t *testing.T) {
959959 "" ,
960960 "0.2.0-rc0" ,
961961 },
962+ {
963+ false ,
964+ false ,
965+ "kata-shim version 0.2.0-xxxxxxxxxxxxx" ,
966+ "" ,
967+ "0.2.0" ,
968+ },
962969 }
963970
964971 origVersion := version
Original file line number Diff line number Diff line change @@ -161,7 +161,13 @@ func constructVersionInfo(version string) VersionInfo {
161161 return unknownVersionInfo
162162 }
163163
164- pres := strings .Split (sv .Pre [0 ].VersionStr , "-" )
164+ var pres string
165+ if len (sv .Pre ) > 0 {
166+ presSplit := strings .Split (sv .Pre [0 ].VersionStr , "-" )
167+ if len (presSplit ) > 2 {
168+ pres = presSplit [1 ]
169+ }
170+ }
165171
166172 // version contains Commit info.
167173 if len (pres ) > 1 {
@@ -170,7 +176,7 @@ func constructVersionInfo(version string) VersionInfo {
170176 Major : sv .Major ,
171177 Minor : sv .Minor ,
172178 Patch : sv .Patch ,
173- Commit : pres [ 1 ] ,
179+ Commit : pres ,
174180 }
175181 }
176182
You can’t perform that action at this time.
0 commit comments