Match on cri-o socket suffix only

This deals with the case that a user can configure cri-o to use
/run/crio/crio.sock and get very confusing behavior.

See https://github.com/cri-o/cri-o/issues/7010#issuecomment-1594149469
This commit is contained in:
David Leadbeater
2023-06-16 17:53:04 +10:00
parent c51915c1c1
commit 2c5a11a55b
4 changed files with 13 additions and 6 deletions

View File

@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/google/cadvisor/container/crio"
cadvisorfs "github.com/google/cadvisor/fs"
)
@@ -37,7 +38,7 @@ func TestImageFsInfoLabel(t *testing.T) {
expectedError error
}{{
description: "LabelCrioImages should be returned",
runtimeEndpoint: CrioSocket,
runtimeEndpoint: crio.CrioSocket,
expectedLabel: cadvisorfs.LabelCrioImages,
expectedError: nil,
}, {