diff --git a/internal/fullnode/pvc_builder.go b/internal/fullnode/pvc_builder.go index b895872a..e3e3b8ed 100644 --- a/internal/fullnode/pvc_builder.go +++ b/internal/fullnode/pvc_builder.go @@ -104,12 +104,15 @@ func pvcResources( name string, dataSource *dataSource, existingSize resource.Quantity, -) corev1.ResourceRequirements { - var reqs = crd.Spec.VolumeClaimTemplate.Resources.DeepCopy() +) corev1.VolumeResourceRequirements { + reqs := crd.Spec.VolumeClaimTemplate.Resources.DeepCopy() if dataSource != nil { - reqs.Requests[corev1.ResourceStorage] = dataSource.size - return *reqs + return corev1.VolumeResourceRequirements{ + Requests: corev1.ResourceList{ + corev1.ResourceStorage: dataSource.size, + }, + } } if autoScale := crd.Status.SelfHealing.PVCAutoScale; autoScale != nil { @@ -127,5 +130,8 @@ func pvcResources( reqs.Requests[corev1.ResourceStorage] = existingSize } - return *reqs + return corev1.VolumeResourceRequirements{ + Requests: reqs.Requests, + Limits: reqs.Limits, + } } diff --git a/internal/statefuljob/pvc.go b/internal/statefuljob/pvc.go index 10ce892c..60162141 100644 --- a/internal/statefuljob/pvc.go +++ b/internal/statefuljob/pvc.go @@ -30,7 +30,7 @@ func BuildPVCs(crd *cosmosalpha.StatefulJob, vs *snapshotv1.VolumeSnapshot) ([]* Kind: vs.Kind, Name: vs.Name, }, - Resources: corev1.ResourceRequirements{ + Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{corev1.ResourceStorage: storage}, }, },