HoustonPutman commented on a change in pull request #193: URL: https://github.com/apache/lucene-solr-operator/pull/193#discussion_r566367646
########## File path: controllers/solrcloud_controller.go ########## @@ -182,44 +182,61 @@ func (r *SolrCloudReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { } } - // Generate ConfigMap unless the user supplied a custom ConfigMap for solr.xml ... but the provided ConfigMap - // might be for the Prometheus exporter, so we only care if they provide a solr.xml in the CM - solrXmlConfigMapName := instance.ConfigMapName() - solrXmlMd5 := "" + // Generate ConfigMap unless the user supplied a custom ConfigMap for solr.xml + configMapInfo := make(map[string]string) if instance.Spec.CustomSolrKubeOptions.ConfigMapOptions != nil && instance.Spec.CustomSolrKubeOptions.ConfigMapOptions.ProvidedConfigMap != "" { + providedConfigMapName := instance.Spec.CustomSolrKubeOptions.ConfigMapOptions.ProvidedConfigMap foundConfigMap := &corev1.ConfigMap{} - nn := types.NamespacedName{Name: instance.Spec.CustomSolrKubeOptions.ConfigMapOptions.ProvidedConfigMap, Namespace: instance.Namespace} + nn := types.NamespacedName{Name: providedConfigMapName, Namespace: instance.Namespace} err = r.Get(context.TODO(), nn, foundConfigMap) if err != nil { return requeueOrNot, err // if they passed a providedConfigMap name, then it must exist } - // ConfigMap doesn't have to have a solr.xml, but if it does, then it needs to be valid! if foundConfigMap.Data != nil { - solrXml, ok := foundConfigMap.Data["solr.xml"] - if ok { + logXml, hasLogXml := foundConfigMap.Data[util.LogXmlFile] + solrXml, hasSolrXml := foundConfigMap.Data[util.SolrXmlFile] + + // if there's a user-provided config, it must have one of the expected keys + if !hasLogXml && !hasSolrXml { + return requeueOrNot, fmt.Errorf("User provided ConfigMap %s must have one of 'solr.xml' and/or 'log4j2.xml'", Review comment: https://github.com/apache/lucene-solr-operator/blob/main/controllers/solrcloud_controller.go#L330 Just a simple thing for us to look for when implementing events. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org