From 1ee64588d71add8f07276b8061cad42822461378 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:10:30 -0700 Subject: [PATCH] handle type change --- internal/fullnode/pvc_builder.go | 16 +++++++++++----- internal/statefuljob/pvc.go | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) 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}, }, },