Make the created statefulset have the new reconciled solr cloud status (#47)
Signed-off-by: Tim TerlegÄrd <tim.terlegard@infomaker.se>
diff --git a/controllers/solrcloud_controller.go b/controllers/solrcloud_controller.go
index 8d7cdcf..6780ea8 100644
--- a/controllers/solrcloud_controller.go
+++ b/controllers/solrcloud_controller.go
@@ -209,7 +209,7 @@
if !blockReconciliationOfStatefulSet {
// Generate StatefulSet
- statefulSet := util.GenerateStatefulSet(instance, IngressBaseUrl, hostNameIpMap)
+ statefulSet := util.GenerateStatefulSet(instance, &newStatus, IngressBaseUrl, hostNameIpMap)
if err := controllerutil.SetControllerReference(instance, statefulSet, r.scheme); err != nil {
return reconcile.Result{}, err
}
diff --git a/controllers/util/solr_util.go b/controllers/util/solr_util.go
index 544b3f6..4cd19f1 100644
--- a/controllers/util/solr_util.go
+++ b/controllers/util/solr_util.go
@@ -48,7 +48,7 @@
// replicas: the number of replicas for the SolrCloud instance
// storage: the size of the storage for the SolrCloud instance (e.g. 100Gi)
// zkConnectionString: the connectionString of the ZK instance to connect to
-func GenerateStatefulSet(solrCloud *solr.SolrCloud, ingressBaseDomain string, hostNameIPs map[string]string) *appsv1.StatefulSet {
+func GenerateStatefulSet(solrCloud *solr.SolrCloud, solrCloudStatus *solr.SolrCloudStatus, ingressBaseDomain string, hostNameIPs map[string]string) *appsv1.StatefulSet {
gracePeriodTerm := int64(10)
fsGroup := int64(SolrClientPort)
defaultMode := int32(420)
@@ -217,7 +217,7 @@
},
{
Name: "ZK_HOST",
- Value: solrCloud.ZkConnectionString(),
+ Value: solrCloudStatus.ZkConnectionString(),
},
{
Name: "SOLR_LOG_LEVEL",