From d58ff6c0560b36a5b944684011dcbda9e87bf544 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Sat, 4 Nov 2023 11:52:05 -0400 Subject: [PATCH] allow for cadvisor to detect split filesystem and add some e2e tests --- pkg/kubelet/cadvisor/cadvisor_linux_test.go | 2 +- pkg/kubelet/cadvisor/helpers_linux.go | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/kubelet/cadvisor/cadvisor_linux_test.go b/pkg/kubelet/cadvisor/cadvisor_linux_test.go index bcd961fca8f..c603e6d7f78 100644 --- a/pkg/kubelet/cadvisor/cadvisor_linux_test.go +++ b/pkg/kubelet/cadvisor/cadvisor_linux_test.go @@ -68,7 +68,7 @@ func TestContainerFsInfoLabel(t *testing.T) { }{{ description: "LabelCrioWriteableImages should be returned", runtimeEndpoint: crio.CrioSocket, - expectedLabel: LabelCrioContainers, + expectedLabel: cadvisorfs.LabelCrioContainers, expectedError: nil, }, { description: "Cannot find valid imagefs label", diff --git a/pkg/kubelet/cadvisor/helpers_linux.go b/pkg/kubelet/cadvisor/helpers_linux.go index 598425e503d..684274787e3 100644 --- a/pkg/kubelet/cadvisor/helpers_linux.go +++ b/pkg/kubelet/cadvisor/helpers_linux.go @@ -26,11 +26,6 @@ import ( cadvisorfs "github.com/google/cadvisor/fs" ) -// LabelCrioContainers is a label to allow for cadvisor to track writeable layers -// separately from read-only layers. -// Once CAdvisor upstream changes are merged, we should remove this constant -const LabelCrioContainers string = "crio-containers" - // imageFsInfoProvider knows how to translate the configured runtime // to its file system label for images. type imageFsInfoProvider struct { @@ -50,7 +45,7 @@ func (i *imageFsInfoProvider) ImageFsInfoLabel() (string, error) { // For remote runtimes, it handles addition runtimes natively understood by cAdvisor. func (i *imageFsInfoProvider) ContainerFsInfoLabel() (string, error) { if detectCrioWorkaround(i) { - return LabelCrioContainers, nil + return cadvisorfs.LabelCrioContainers, nil } return "", fmt.Errorf("no containerfs label for configured runtime") }