fix: enable and fixes rules from testifylint on test package

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-06-29 17:28:30 +00:00
parent fa75b4371d
commit 7bccbaf996
19 changed files with 19 additions and 41 deletions

View File

@@ -20,6 +20,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
@@ -65,7 +66,7 @@ func TestMixinRestrictedPodSecurity(t *testing.T) {
for _, pod := range restrictablePods {
t.Run(pod.Name, func(t *testing.T) {
p := pod // closure
assert.NoError(t, MixinRestrictedPodSecurity(&p))
require.NoError(t, MixinRestrictedPodSecurity(&p))
assert.Equal(t, GetRestrictedPodSecurityContext(), p.Spec.SecurityContext,
"Mixed in PodSecurityContext should equal the from-scratch PodSecurityContext")
assert.Equal(t, GetRestrictedContainerSecurityContext(), p.Spec.Containers[0].SecurityContext,