You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.9 KiB

  1. --- a/pkg/spec/config_linux.go
  2. +++ b/pkg/spec/config_linux.go
  3. @@ -294,8 +294,8 @@ func (c *CreateConfig) createBlockIO() (
  4. lwd := spec.LinuxWeightDevice{
  5. Weight: &wd.Weight,
  6. }
  7. - lwd.Major = int64(unix.Major(wdStat.Rdev))
  8. - lwd.Minor = int64(unix.Minor(wdStat.Rdev))
  9. + lwd.Major = int64(unix.Major(uint64(wdStat.Rdev))) //nolint: unconvert
  10. + lwd.Minor = int64(unix.Minor(uint64(wdStat.Rdev))) //nolint: unconvert
  11. lwds = append(lwds, lwd)
  12. }
  13. bio.WeightDevice = lwds
  14. @@ -357,8 +357,8 @@ func makeThrottleArray(throttleInput []s
  15. ltd := spec.LinuxThrottleDevice{
  16. Rate: t.rate,
  17. }
  18. - ltd.Major = int64(unix.Major(ltdStat.Rdev))
  19. - ltd.Minor = int64(unix.Minor(ltdStat.Rdev))
  20. + ltd.Major = int64(unix.Major(uint64(ltdStat.Rdev))) // nolint: unconvert
  21. + ltd.Minor = int64(unix.Minor(uint64(ltdStat.Rdev))) // nolint: unconvert
  22. ltds = append(ltds, ltd)
  23. }
  24. return ltds, nil
  25. --- a/pkg/specgen/generate/container.go
  26. +++ b/pkg/specgen/generate/container.go
  27. @@ -282,8 +282,8 @@ func finishThrottleDevices(s *specgen.Sp
  28. if err := unix.Stat(k, &statT); err != nil {
  29. return err
  30. }
  31. - v.Major = (int64(unix.Major(statT.Rdev)))
  32. - v.Minor = (int64(unix.Minor(statT.Rdev)))
  33. + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
  34. + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
  35. s.ResourceLimits.BlockIO.ThrottleReadBpsDevice = append(s.ResourceLimits.BlockIO.ThrottleReadBpsDevice, v)
  36. }
  37. }
  38. @@ -293,8 +293,8 @@ func finishThrottleDevices(s *specgen.Sp
  39. if err := unix.Stat(k, &statT); err != nil {
  40. return err
  41. }
  42. - v.Major = (int64(unix.Major(statT.Rdev)))
  43. - v.Minor = (int64(unix.Minor(statT.Rdev)))
  44. + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
  45. + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
  46. s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice, v)
  47. }
  48. }
  49. @@ -304,8 +304,8 @@ func finishThrottleDevices(s *specgen.Sp
  50. if err := unix.Stat(k, &statT); err != nil {
  51. return err
  52. }
  53. - v.Major = (int64(unix.Major(statT.Rdev)))
  54. - v.Minor = (int64(unix.Minor(statT.Rdev)))
  55. + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
  56. + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
  57. s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice, v)
  58. }
  59. }
  60. @@ -315,8 +315,8 @@ func finishThrottleDevices(s *specgen.Sp
  61. if err := unix.Stat(k, &statT); err != nil {
  62. return err
  63. }
  64. - v.Major = (int64(unix.Major(statT.Rdev)))
  65. - v.Minor = (int64(unix.Minor(statT.Rdev)))
  66. + v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
  67. + v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
  68. s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice, v)
  69. }
  70. }