mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Various fixes to enable kubelet to switch to kuberuntime/dockershim
This commit is contained in:
parent
1c3c1ac514
commit
bd357e9761
@ -17,8 +17,6 @@ limitations under the License.
|
||||
package kuberuntime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/credentialprovider"
|
||||
@ -130,7 +128,8 @@ func (m *kubeGenericRuntimeManager) RemoveImage(image kubecontainer.ImageSpec) e
|
||||
}
|
||||
|
||||
// ImageStats returns the statistics of the image.
|
||||
// TODO: Implement this function.
|
||||
func (m *kubeGenericRuntimeManager) ImageStats() (*kubecontainer.ImageStats, error) {
|
||||
// TODO: support image stats in new runtime interface
|
||||
return nil, fmt.Errorf("not implemented")
|
||||
var usageBytes uint64 = 0
|
||||
return &kubecontainer.ImageStats{TotalStorageBytes: usageBytes}, nil
|
||||
}
|
||||
|
@ -27,6 +27,10 @@ import (
|
||||
|
||||
const (
|
||||
UnsupportedReason = "SysctlUnsupported"
|
||||
// CRI uses semver-compatible API version, while docker does not
|
||||
// (e.g., 1.24). Append the version with a ".0" so that it works
|
||||
// with both the CRI and dockertools comparison logic.
|
||||
dockerMinimumAPIVersion = "1.24.0"
|
||||
)
|
||||
|
||||
type runtimeAdmitHandler struct {
|
||||
@ -45,7 +49,7 @@ func NewRuntimeAdmitHandler(runtime container.Runtime) (*runtimeAdmitHandler, er
|
||||
}
|
||||
|
||||
// only Docker >= 1.12 supports sysctls
|
||||
c, err := v.Compare(dockertools.DockerV112APIVersion)
|
||||
c, err := v.Compare(dockerMinimumAPIVersion)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to compare Docker version for sysctl support: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user