Revert "node: device-mgr: Handle recovery flow by checking if healthy devices exist"

This commit is contained in:
David Porter
2023-03-07 11:50:52 -08:00
committed by GitHub
parent 2bac225e42
commit 9c20cee504
4 changed files with 11 additions and 518 deletions

View File

@@ -87,16 +87,11 @@ func updateImageAllowList(ctx context.Context) {
} else {
e2epod.ImagePrePullList.Insert(gpuDevicePluginImage)
}
if samplePluginImage, err := getContainerImageFromE2ETestDaemonset(SampleDevicePluginDSYAML); err != nil {
if samplePluginImage, err := getSampleDevicePluginImage(); err != nil {
klog.Errorln(err)
} else {
e2epod.ImagePrePullList.Insert(samplePluginImage)
}
if samplePluginImageCtrlReg, err := getContainerImageFromE2ETestDaemonset(SampleDevicePluginControlRegistrationDSYAML); err != nil {
klog.Errorln(err)
} else {
e2epod.ImagePrePullList.Insert(samplePluginImageCtrlReg)
}
}
func getNodeProblemDetectorImage() string {
@@ -227,19 +222,19 @@ func getGPUDevicePluginImage(ctx context.Context) (string, error) {
return ds.Spec.Template.Spec.Containers[0].Image, nil
}
func getContainerImageFromE2ETestDaemonset(dsYamlPath string) (string, error) {
data, err := e2etestfiles.Read(dsYamlPath)
func getSampleDevicePluginImage() (string, error) {
data, err := e2etestfiles.Read(SampleDevicePluginDSYAML)
if err != nil {
return "", fmt.Errorf("failed to read the daemonset yaml: %w", err)
return "", fmt.Errorf("failed to read the sample plugin yaml: %w", err)
}
ds, err := e2emanifest.DaemonSetFromData(data)
if err != nil {
return "", fmt.Errorf("failed to parse daemonset yaml: %w", err)
return "", fmt.Errorf("failed to parse daemon set for sample plugin: %w", err)
}
if len(ds.Spec.Template.Spec.Containers) < 1 {
return "", fmt.Errorf("failed to parse the container image: cannot extract the container from YAML")
return "", fmt.Errorf("failed to parse the sample plugin image: cannot extract the container from YAML")
}
return ds.Spec.Template.Spec.Containers[0].Image, nil
}