Clean up logic for deprecated flag --container-runtime in kubelet

Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
This commit is contained in:
Ciprian Hacman
2022-01-06 09:06:22 +02:00
parent 3b4a9cdfff
commit 0819451ea6
23 changed files with 53 additions and 131 deletions

View File

@@ -26,7 +26,6 @@ import (
"github.com/stretchr/testify/assert"
cadvisorfs "github.com/google/cadvisor/fs"
"k8s.io/kubernetes/pkg/kubelet/types"
)
func TestImageFsInfoLabel(t *testing.T) {
@@ -38,13 +37,11 @@ func TestImageFsInfoLabel(t *testing.T) {
expectedError error
}{{
description: "LabelCrioImages should be returned",
runtime: types.RemoteContainerRuntime,
runtimeEndpoint: CrioSocket,
expectedLabel: cadvisorfs.LabelCrioImages,
expectedError: nil,
}, {
description: "Cannot find valid imagefs label",
runtime: "invalid-runtime",
runtimeEndpoint: "",
expectedLabel: "",
expectedError: fmt.Errorf("no imagefs label for configured runtime"),
@@ -52,7 +49,7 @@ func TestImageFsInfoLabel(t *testing.T) {
for _, tc := range testcases {
t.Run(tc.description, func(t *testing.T) {
infoProvider := NewImageFsInfoProvider(tc.runtime, tc.runtimeEndpoint)
infoProvider := NewImageFsInfoProvider(tc.runtimeEndpoint)
label, err := infoProvider.ImageFsInfoLabel()
assert.Equal(t, tc.expectedLabel, label)
assert.Equal(t, tc.expectedError, err)