Commit c9ad8dcd authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #47900 from yiqinguo/yiqinguo_add_type_judgment

Automatic merge from submit-queue Add type conversion judgment If do not type conversion judgment, there may be panic. **Release note**: ```release-note NONE ```
parents 343d751b d170b0ca
......@@ -455,10 +455,13 @@ func (ds *dockerService) getDockerVersionFromCache() (*dockertypes.Version, erro
// We only store on key in the cache.
const dummyKey = "version"
value, err := ds.versionCache.Get(dummyKey)
dv := value.(*dockertypes.Version)
if err != nil {
return nil, err
}
dv, ok := value.(*dockertypes.Version)
if !ok {
return nil, fmt.Errorf("Converted to *dockertype.Version error")
}
return dv, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment