From 45a6ed8d56d4a651acb3ca55555da3273a2e4a9f Mon Sep 17 00:00:00 2001 From: Jason Deal Date: Wed, 13 Dec 2023 13:56:17 -0800 Subject: [PATCH] chore: update library usage --- .../provisioning/scheduling/suite_test.go | 20 +++++++++---------- pkg/test/pods.go | 2 +- pkg/test/storage.go | 9 ++++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pkg/controllers/provisioning/scheduling/suite_test.go b/pkg/controllers/provisioning/scheduling/suite_test.go index d97d350767..c205d34791 100644 --- a/pkg/controllers/provisioning/scheduling/suite_test.go +++ b/pkg/controllers/provisioning/scheduling/suite_test.go @@ -2842,7 +2842,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -2900,7 +2900,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -2946,7 +2946,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -2995,7 +2995,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -3058,7 +3058,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -3114,7 +3114,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -3151,7 +3151,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -3202,7 +3202,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -3307,7 +3307,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, @@ -3357,7 +3357,7 @@ var _ = Context("NodePool", func() { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, diff --git a/pkg/test/pods.go b/pkg/test/pods.go index b3768c97f7..ec26eae2c3 100644 --- a/pkg/test/pods.go +++ b/pkg/test/pods.go @@ -96,7 +96,7 @@ func Pod(overrides ...PodOptions) *v1.Pod { AccessModes: []v1.PersistentVolumeAccessMode{ v1.ReadWriteOnce, }, - Resources: v1.ResourceRequirements{ + Resources: v1.VolumeResourceRequirements{ Requests: v1.ResourceList{ v1.ResourceStorage: resource.MustParse("1Gi"), }, diff --git a/pkg/test/storage.go b/pkg/test/storage.go index eaa40c14c7..656fc01315 100644 --- a/pkg/test/storage.go +++ b/pkg/test/storage.go @@ -83,7 +83,7 @@ type PersistentVolumeClaimOptions struct { metav1.ObjectMeta StorageClassName *string VolumeName string - Resources v1.ResourceRequirements + Resources v1.VolumeResourceRequirements } func PersistentVolumeClaim(overrides ...PersistentVolumeClaimOptions) *v1.PersistentVolumeClaim { @@ -94,7 +94,7 @@ func PersistentVolumeClaim(overrides ...PersistentVolumeClaimOptions) *v1.Persis } } if len(options.Resources.Requests) == 0 { - options.Resources = v1.ResourceRequirements{Requests: v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Gi")}} + options.Resources = v1.VolumeResourceRequirements{Requests: v1.ResourceList{v1.ResourceStorage: resource.MustParse("1Gi")}} } return &v1.PersistentVolumeClaim{ ObjectMeta: NamespacedObjectMeta(options.ObjectMeta), @@ -102,7 +102,10 @@ func PersistentVolumeClaim(overrides ...PersistentVolumeClaimOptions) *v1.Persis StorageClassName: options.StorageClassName, VolumeName: options.VolumeName, AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, - Resources: options.Resources, + Resources: v1.VolumeResourceRequirements{ + Limits: options.Resources.Limits, + Requests: options.Resources.Requests, + }, }, } }