lint fixes found from 0.26.1 release preparation

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
This commit is contained in:
Tuomas Katila 2023-05-02 11:31:06 +03:00
parent ed08d11aa3
commit 342554c666
2 changed files with 4 additions and 3 deletions

View File

@ -182,6 +182,7 @@ func (dp *devicePlugin) bypathMountsForPci(cardPath, cardName, bypathDir string)
for _, f := range files {
if strings.HasPrefix(f.Name(), linkPrefix) {
absPath := path.Join(bypathDir, f.Name())
mounts = append(mounts, pluginapi.Mount{
ContainerPath: absPath,
HostPath: absPath,

View File

@ -42,14 +42,14 @@ func validatePluginImage(image, expectedImageName string, expectedMinVersion *ve
imageName := parts[0]
versionStr := parts[1]
// If user provided faulty SHA digest, the image name may include @sha256 suffix so strip it
// If user provided faulty SHA digest, the image name may include @sha256 suffix so strip it.
if strings.TrimSuffix(imageName, "@sha256") != expectedImageName {
return errors.Errorf("incorrect image name %q. Make sure you use '<vendor>/%s'.", imageName, expectedImageName)
return errors.Errorf("incorrect image name %q. Make sure you use '<vendor>/%s'", imageName, expectedImageName)
}
ver, err := version.ParseSemantic(versionStr)
if err != nil {
return errors.Wrapf(err, "unable to parse version %q. Make sure it's either valid SHA digest or semver tag.", versionStr)
return errors.Wrapf(err, "unable to parse version %q. Make sure it's either valid SHA digest or semver tag", versionStr)
}
if !ver.AtLeast(expectedMinVersion) {