mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
invoke getTypedVersion() instead of direct runtime call
This commit is contained in:
parent
c981bce007
commit
babdcd0d14
@ -188,7 +188,7 @@ func NewKubeGenericRuntimeManager(
|
|||||||
logReduction: logreduction.NewLogReduction(identicalErrorDelay),
|
logReduction: logreduction.NewLogReduction(identicalErrorDelay),
|
||||||
}
|
}
|
||||||
|
|
||||||
typedVersion, err := kubeRuntimeManager.runtimeService.Version(kubeRuntimeAPIVersion)
|
typedVersion, err := kubeRuntimeManager.getTypedVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("Get runtime version failed: %v", err)
|
klog.Errorf("Get runtime version failed: %v", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -253,17 +253,15 @@ func newRuntimeVersion(version string) (*utilversion.Version, error) {
|
|||||||
func (m *kubeGenericRuntimeManager) getTypedVersion() (*runtimeapi.VersionResponse, error) {
|
func (m *kubeGenericRuntimeManager) getTypedVersion() (*runtimeapi.VersionResponse, error) {
|
||||||
typedVersion, err := m.runtimeService.Version(kubeRuntimeAPIVersion)
|
typedVersion, err := m.runtimeService.Version(kubeRuntimeAPIVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("Get remote runtime typed version failed: %v", err)
|
return nil, fmt.Errorf("get remote runtime typed version failed: %v", err)
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
return typedVersion, nil
|
return typedVersion, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version returns the version information of the container runtime.
|
// Version returns the version information of the container runtime.
|
||||||
func (m *kubeGenericRuntimeManager) Version() (kubecontainer.Version, error) {
|
func (m *kubeGenericRuntimeManager) Version() (kubecontainer.Version, error) {
|
||||||
typedVersion, err := m.runtimeService.Version(kubeRuntimeAPIVersion)
|
typedVersion, err := m.getTypedVersion()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("Get remote runtime version failed: %v", err)
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user