Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
  • Loading branch information
eguzki committed Sep 27, 2024
1 parent 42236a8 commit 347991e
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions pkg/limitador/k8s_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"gotest.tools/assert"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -116,7 +115,7 @@ func TestDeployment(t *testing.T) {
t.Run("volumeMounts", func(subT *testing.T) {
limObj := newTestLimitadorObj("some-name", "some-ns", nil)
deployment := Deployment(limObj, DeploymentOptions{
VolumeMounts: []v1.VolumeMount{
VolumeMounts: []corev1.VolumeMount{
{
Name: "A",
MountPath: "/path/A",
Expand All @@ -129,7 +128,7 @@ func TestDeployment(t *testing.T) {
})
assert.Assert(subT, len(deployment.Spec.Template.Spec.Containers) == 1)
assert.DeepEqual(subT, deployment.Spec.Template.Spec.Containers[0].VolumeMounts,
[]v1.VolumeMount{
[]corev1.VolumeMount{
{
Name: "A",
MountPath: "/path/A",
Expand All @@ -145,22 +144,22 @@ func TestDeployment(t *testing.T) {
t.Run("volumes", func(subT *testing.T) {
limObj := newTestLimitadorObj("some-name", "some-ns", nil)
deployment := Deployment(limObj, DeploymentOptions{
Volumes: []v1.Volume{
Volumes: []corev1.Volume{
{
Name: "A",
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: v1.LocalObjectReference{
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "secretA",
},
},
},
},
{
Name: "B",
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: v1.LocalObjectReference{
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "secretB",
},
},
Expand All @@ -169,22 +168,22 @@ func TestDeployment(t *testing.T) {
},
})
assert.DeepEqual(subT, deployment.Spec.Template.Spec.Volumes,
[]v1.Volume{
[]corev1.Volume{
{
Name: "A",
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: v1.LocalObjectReference{
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "secretA",
},
},
},
},
{
Name: "B",
VolumeSource: v1.VolumeSource{
ConfigMap: &v1.ConfigMapVolumeSource{
LocalObjectReference: v1.LocalObjectReference{
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "secretB",
},
},
Expand Down Expand Up @@ -361,14 +360,14 @@ func TestPVC(t *testing.T) {
limObj := newDiskStorageLimitador("some-name")
pvc := PVC(limObj)
assert.DeepEqual(subT, pvc.Spec.AccessModes,
[]v1.PersistentVolumeAccessMode{v1.ReadWriteOnce})
[]corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce})
})

t.Run("default resources", func(subT *testing.T) {
limObj := newDiskStorageLimitador("some-name")
pvc := PVC(limObj)
assert.DeepEqual(subT, pvc.Spec.Resources.Requests,
v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Gi")},
corev1.ResourceList{corev1.ResourceStorage: resource.MustParse("1Gi")},
)
})

Expand All @@ -381,7 +380,7 @@ func TestPVC(t *testing.T) {
}
pvc := PVC(limObj)
assert.DeepEqual(subT, pvc.Spec.Resources.Requests,
v1.ResourceList{v1.ResourceStorage: resource.MustParse("100Gi")},
corev1.ResourceList{corev1.ResourceStorage: resource.MustParse("100Gi")},
)
})

Expand Down

0 comments on commit 347991e

Please sign in to comment.