Skip to content

Commit d5d1e45

Browse files
authored
Merge pull request #687 from rojkov/master
e2e: fix linter warnings
2 parents 1088258 + 941b19b commit d5d1e45

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/e2e/utils/utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ func TestContainersRunAsNonRoot(pods []v1.Pod) error {
161161
for _, p := range pods {
162162
for _, c := range append(p.Spec.InitContainers, p.Spec.Containers...) {
163163
if !*c.SecurityContext.RunAsNonRoot {
164-
return fmt.Errorf("%s (container: %s): RunAsNonRoot is not true", p.Name, c.Name)
164+
return errors.Errorf("%s (container: %s): RunAsNonRoot is not true", p.Name, c.Name)
165165
}
166166
if *c.SecurityContext.RunAsGroup == 0 {
167-
return fmt.Errorf("%s (container: %s): RunAsGroup is root (0)", p.Name, c.Name)
167+
return errors.Errorf("%s (container: %s): RunAsGroup is root (0)", p.Name, c.Name)
168168
}
169169
if *c.SecurityContext.RunAsUser == 0 {
170-
return fmt.Errorf("%s (container: %s): RunAsUser is root (0)", p.Name, c.Name)
170+
return errors.Errorf("%s (container: %s): RunAsUser is root (0)", p.Name, c.Name)
171171
}
172172
}
173173
}
@@ -188,7 +188,7 @@ func TestPodsFileSystemInfo(pods []v1.Pod) error {
188188
for _, p := range pods {
189189
for _, c := range append(p.Spec.InitContainers, p.Spec.Containers...) {
190190
if !*c.SecurityContext.ReadOnlyRootFilesystem {
191-
return fmt.Errorf("%s (container: %s): Writable root filesystem", p.Name, c.Name)
191+
return errors.Errorf("%s (container: %s): Writable root filesystem", p.Name, c.Name)
192192
}
193193
printVolumeMounts(c.VolumeMounts)
194194
}

0 commit comments

Comments
 (0)