Unverified Commit ef9d2170 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #54827 from dashpole/cadvisor_godep

Automatic merge from submit-queue (batch tested with PRs 54774, 54820, 52192, 54827). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Update cadvisor godeps to v0.27.2 This fixes an issue with overlay2 support for Docker and CRI-O, which was introduced in 1.8. We should cherrypick this to the 1.8 branch. cc @kubernetes/sig-node-pr-reviews @derekwaynecarr @dchen1107 ```release-note Fix overlay2 container disk metrics for Docker and CRI-O ```
parents 3c6ff87f 59274261
......@@ -18,6 +18,7 @@ package crio
import (
"fmt"
"path"
"path/filepath"
"strconv"
"strings"
"time"
......@@ -142,6 +143,12 @@ func newCrioContainerHandler(
// get device ID from root, otherwise, it's going to error out as overlay
// mounts doesn't have fixed dev ids.
rootfsStorageDir = strings.TrimSuffix(rootfsStorageDir, "/merged")
switch storageDriver {
case overlayStorageDriver, overlay2StorageDriver:
// overlay and overlay2 driver are the same "overlay2" driver so treat
// them the same.
rootfsStorageDir = filepath.Join(rootfsStorageDir, "diff")
}
// TODO: extract object mother method
handler := &crioContainerHandler{
......
......@@ -43,7 +43,8 @@ import (
const (
// The read write layers exist here.
aufsRWLayer = "diff"
aufsRWLayer = "diff"
overlay2RWLayer = "diff"
// Path to the directory where docker stores log files if the json logging driver is enabled.
pathToContainersDir = "containers"
......@@ -195,8 +196,10 @@ func newDockerContainerHandler(
switch storageDriver {
case aufsStorageDriver:
rootfsStorageDir = path.Join(storageDir, string(aufsStorageDriver), aufsRWLayer, rwLayerID)
case overlayStorageDriver, overlay2StorageDriver:
case overlayStorageDriver:
rootfsStorageDir = path.Join(storageDir, string(storageDriver), rwLayerID)
case overlay2StorageDriver:
rootfsStorageDir = path.Join(storageDir, string(storageDriver), rwLayerID, overlay2RWLayer)
case zfsStorageDriver:
status, err := Status()
if err != 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