@@ -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