diff --git a/internal/fullnode/peer_collector.go b/internal/fullnode/peer_collector.go index 555ef803..37c27c3a 100644 --- a/internal/fullnode/peer_collector.go +++ b/internal/fullnode/peer_collector.go @@ -110,7 +110,7 @@ func (c PeerCollector) Collect(ctx context.Context, crd *cosmosv1.CosmosFullNode if crd.Spec.Service.ClusterDomain != nil { clusterDomain = *crd.Spec.Service.ClusterDomain } - for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ { + for i := int32(0); i < crd.Spec.Replicas; i++ { secretName := nodeKeySecretName(crd, i) var secret corev1.Secret // Hoping the caching layer kubebuilder prevents API errors or rate limits. Simplifies logic to use a Get here diff --git a/internal/fullnode/service_builder.go b/internal/fullnode/service_builder.go index 2831a12a..db534553 100644 --- a/internal/fullnode/service_builder.go +++ b/internal/fullnode/service_builder.go @@ -32,7 +32,7 @@ func BuildServices(crd *cosmosv1.CosmosFullNode) []diff.Resource[*corev1.Service maxExternal := lo.Clamp(max, 0, crd.Spec.Replicas) p2ps := make([]diff.Resource[*corev1.Service], crd.Spec.Replicas) - for i := int32(0); i < crd.Spec.Replicas; i++ { + for i := crd.Spec.Ordinal.Start; i < crd.Spec.Ordinal.Start+crd.Spec.Replicas; i++ { ordinal := i var svc corev1.Service svc.Name = p2pServiceName(crd, ordinal)