Skip to content

Commit

Permalink
chore: update library usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed Dec 20, 2023
1 parent aa46619 commit 45a6ed8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
20 changes: 10 additions & 10 deletions pkg/controllers/provisioning/scheduling/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down Expand Up @@ -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"),
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
Expand Down
9 changes: 6 additions & 3 deletions pkg/test/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -94,15 +94,18 @@ 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),
Spec: v1.PersistentVolumeClaimSpec{
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,
},
},
}
}
Expand Down

0 comments on commit 45a6ed8

Please sign in to comment.