mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
lint fixes found from 0.26.1 release preparation
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
This commit is contained in:
parent
ed08d11aa3
commit
342554c666
@ -182,6 +182,7 @@ func (dp *devicePlugin) bypathMountsForPci(cardPath, cardName, bypathDir string)
|
|||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
if strings.HasPrefix(f.Name(), linkPrefix) {
|
if strings.HasPrefix(f.Name(), linkPrefix) {
|
||||||
absPath := path.Join(bypathDir, f.Name())
|
absPath := path.Join(bypathDir, f.Name())
|
||||||
|
|
||||||
mounts = append(mounts, pluginapi.Mount{
|
mounts = append(mounts, pluginapi.Mount{
|
||||||
ContainerPath: absPath,
|
ContainerPath: absPath,
|
||||||
HostPath: absPath,
|
HostPath: absPath,
|
||||||
|
@ -42,14 +42,14 @@ func validatePluginImage(image, expectedImageName string, expectedMinVersion *ve
|
|||||||
imageName := parts[0]
|
imageName := parts[0]
|
||||||
versionStr := parts[1]
|
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 {
|
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)
|
ver, err := version.ParseSemantic(versionStr)
|
||||||
if err != nil {
|
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) {
|
if !ver.AtLeast(expectedMinVersion) {
|
||||||
|
Loading…
Reference in New Issue
Block a user