mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #84191 from langyenan/getTypedVersion
invoke getTypedVersion() instead of direct runtime call
This commit is contained in:
commit
9ddbc90039
@ -192,7 +192,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
|
||||||
@ -268,17 +268,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