summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/validate.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-27 04:50:01 -0400
committerGitHub <noreply@github.com>2022-04-27 04:50:01 -0400
commit053b09660ffbe2df2104186c67e39be70764ff63 (patch)
treeb9d8d32e146eb1ca1a3385e61b24d276dabc1cf0 /pkg/specgen/generate/validate.go
parent5ac00a7287e4a9e6292f4a6ca5dfa9a02e5ca907 (diff)
parent4f8ece76fff31d31570af56e0ec4a4092e015b33 (diff)
downloadpodman-053b09660ffbe2df2104186c67e39be70764ff63.tar.gz
podman-053b09660ffbe2df2104186c67e39be70764ff63.tar.bz2
podman-053b09660ffbe2df2104186c67e39be70764ff63.zip
Merge pull request #13997 from Luap99/gocritic
enable gocritic linter
Diffstat (limited to 'pkg/specgen/generate/validate.go')
-rw-r--r--pkg/specgen/generate/validate.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/specgen/generate/validate.go b/pkg/specgen/generate/validate.go
index 8da3f2936..44c7818e7 100644
--- a/pkg/specgen/generate/validate.go
+++ b/pkg/specgen/generate/validate.go
@@ -47,10 +47,8 @@ func verifyContainerResourcesCgroupV1(s *specgen.SpecGenerator) ([]string, error
if !sysInfo.MemorySwappiness {
warnings = append(warnings, "Your kernel does not support memory swappiness capabilities, or the cgroup is not mounted. Memory swappiness discarded.")
memory.Swappiness = nil
- } else {
- if *memory.Swappiness > 100 {
- return warnings, errors.Errorf("invalid value: %v, valid memory swappiness range is 0-100", *memory.Swappiness)
- }
+ } else if *memory.Swappiness > 100 {
+ return warnings, errors.Errorf("invalid value: %v, valid memory swappiness range is 0-100", *memory.Swappiness)
}
}
if memory.Reservation != nil && !sysInfo.MemoryReservation {