mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Add type conversion judgment
This commit is contained in:
parent
c3dd67dc21
commit
d170b0ca80
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user