mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Fix the nil pointer dereference for comformance spec validation
`verify-conformance-yaml.sh` is used to verify the test spec of conformance e2e test are valid. Bascically, it calls `e2e.test` binary to dump the test spec and then walk the source to generate the `conformance.yaml`. If the `e2e.test` binary is outdated, it's possible that `testInfo` is nil. Access the field from nil will result to `nil pointer dereference` Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
parent
ba1bbb5ac6
commit
1b5d8b0b9b
@ -108,10 +108,9 @@ func main() {
|
||||
testInfo := getTestInfo(spec)
|
||||
if testInfo != nil {
|
||||
testInfos = append(testInfos, testInfo)
|
||||
}
|
||||
|
||||
if err := validateTestName(testInfo.CodeName); err != nil {
|
||||
log.Fatal(err)
|
||||
if err := validateTestName(testInfo.CodeName); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user