From dc23a15c3ad034f7358bf4051d40f2a15ae4eae3 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Wed, 20 Nov 2024 01:55:47 -0700 Subject: [PATCH] name/label update --- internal/fullnode/pvc_builder.go | 6 +++--- internal/fullnode/pvc_control.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/fullnode/pvc_builder.go b/internal/fullnode/pvc_builder.go index 1e98b7f9..abf07b1a 100644 --- a/internal/fullnode/pvc_builder.go +++ b/internal/fullnode/pvc_builder.go @@ -39,15 +39,15 @@ func BuildPVCs( } var pvcs []diff.Resource[*corev1.PersistentVolumeClaim] - for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ { + for i := int32(0); i < crd.Spec.Replicas; i++ { if pvcDisabled(crd, i) { continue } pvc := base.DeepCopy() - name := pvcName(crd, i) + name := pvcName(crd, i+crd.Spec.Ordinal.Start) pvc.Name = name - pvc.Labels[kube.InstanceLabel] = instanceName(crd, i) + pvc.Labels[kube.InstanceLabel] = instanceName(crd, i+crd.Spec.Ordinal.Start) var dataSource *corev1.TypedLocalObjectReference var existingSize resource.Quantity diff --git a/internal/fullnode/pvc_control.go b/internal/fullnode/pvc_control.go index 588daa2b..6786f377 100644 --- a/internal/fullnode/pvc_control.go +++ b/internal/fullnode/pvc_control.go @@ -51,7 +51,7 @@ func (control PVCControl) Reconcile(ctx context.Context, reporter kube.Reporter, dataSources := make(map[int32]*dataSource) if len(currentPVCs) < int(crd.Spec.Replicas) { - for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ { + for i := int32(0); i < crd.Spec.Replicas; i++ { name := pvcName(crd, i) found := false for _, pvc := range currentPVCs {