thelabdude commented on a change in pull request #221:
URL:
https://github.com/apache/lucene-solr-operator/pull/221#discussion_r579471213
##########
File path: controllers/solrprometheusexporter_controller.go
##########
@@ -209,7 +209,22 @@ func (r *SolrPrometheusExporterReconciler) Reconcile(req
ctrl.Request) (ctrl.Res
}
}
- deploy :=
util.GenerateSolrPrometheusExporterDeployment(prometheusExporter,
solrConnectionInfo, configXmlMd5, tlsClientOptions)
+ basicAuthMd5 := ""
+ if prometheusExporter.Spec.SolrReference.BasicAuthSecret != nil {
+ selector :=
prometheusExporter.Spec.SolrReference.BasicAuthSecret
+ basicAuthSecret := &corev1.Secret{}
+ err := r.Get(context.TODO(), types.NamespacedName{Name:
selector.Name, Namespace: prometheusExporter.Namespace}, basicAuthSecret)
+ if err != nil {
+ return reconcile.Result{}, err
+ }
+ passBytes, ok := basicAuthSecret.Data[selector.Key]
Review comment:
Confirmed that only `data` is stored ... here's an example:
```
apiVersion: v1
stringData:
k8s-oper: Test1234
kind: Secret
metadata:
name: user-provided-basic-auth
type: Opaque
```
and `kubectl get secret user-provided-basic-auth -o yaml` gives:
```
apiVersion: v1
data:
k8s-oper: VGVzdDEyMzQ=
kind: Secret
metadata:
name: user-provided-basic-auth
type: Opaque
```
and in the logs, we have:
```
2021-02-19T19:38:56.486Z INFO controllers.SolrCloud For
user-supplied secret, password is: {"namespace": "dev", "solrCloud": "dev",
"password": "Test1234"}
```
_Note: I just added that log message to test this scenario ... it has since
been removed, i.e. we're not logging passwords_
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]