get rid of e2e/framework -> k/k/pkg/kubelet dependency

It's conceptually wrong to have dependencies to k/k/pkg in
the e2e framework code. They should be moved to corresponding
packages, in this particular case to the test/e2e_node.
This commit is contained in:
Ed Bartosh
2023-04-12 21:11:43 +03:00
parent 139a2c54a2
commit 867be8fc3e
13 changed files with 29 additions and 37 deletions

View File

@@ -87,9 +87,12 @@ const (
memoryManagerStateFile = "/var/lib/kubelet/memory_manager_state"
)
var kubeletHealthCheckURL = fmt.Sprintf("http://127.0.0.1:%d/healthz", ports.KubeletHealthzPort)
var containerRuntimeUnitName = ""
var (
kubeletHealthCheckURL = fmt.Sprintf("http://127.0.0.1:%d/healthz", ports.KubeletHealthzPort)
containerRuntimeUnitName = ""
// KubeletConfig is the kubelet configuration the test is running against.
kubeletCfg *kubeletconfig.KubeletConfiguration
)
func getNodeSummary(ctx context.Context) (*stats.Summary, error) {
kubeletConfig, err := getCurrentKubeletConfig(ctx)
@@ -482,7 +485,7 @@ func kubeletHealthCheck(url string) bool {
}
func toCgroupFsName(cgroupName cm.CgroupName) string {
if framework.TestContext.KubeletConfig.CgroupDriver == "systemd" {
if kubeletCfg.CgroupDriver == "systemd" {
return cgroupName.ToSystemd()
}
return cgroupName.ToCgroupfs()