Pass the volumeAttributesClassName attribute#811
Pass the volumeAttributesClassName attribute#811coolstim wants to merge 1 commit intoapache:mainfrom
Conversation
|
@HoustonPutman how do we move this forward? |
|
@janhoy what's the proper way to move this PR forward? |
|
I requested a review by copilot. You can send an email to Solr dev@ list to ping a larger audience. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for the volumeAttributesClassName field in the Helm chart's data storage configuration. The field was already defined in the CRD but was not exposed through the Helm chart values.
Changes:
- Added
volumeAttributesClassNameconfiguration option tovalues.yamlunderdataStorage.persistent.pvc - Updated the SolrCloud template to pass the
volumeAttributesClassNamevalue to the PVC template spec
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| helm/solr/values.yaml | Adds volumeAttributesClassName field with empty string default value under persistent PVC configuration |
| helm/solr/templates/solrcloud.yaml | Conditionally renders volumeAttributesClassName in the PVC spec when the value is set |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{- if .Values.dataStorage.persistent.pvc.volumeAttributesClassName }} | ||
| volumeAttributesClassName: {{ .Values.dataStorage.persistent.pvc.volumeAttributesClassName | quote }} | ||
| {{- end }} |
There was a problem hiding this comment.
The volumeAttributesClassName field is being added inside a spec block that is conditionally rendered (line 139). However, the condition on line 139 only checks for capacity or storageClassName, not volumeAttributesClassName. This means if a user sets only volumeAttributesClassName without setting either storageClassName or capacity, the entire spec block will not be rendered, and volumeAttributesClassName will be silently ignored. The condition on line 139 should be updated to include .Values.dataStorage.persistent.pvc.volumeAttributesClassName in the 'or' expression.
There was a problem hiding this comment.
what copilot is complaining about is that the condition is not added to line 131 https://github.com/coolstim/solr-operator/blob/753ee4ac69eb5638ea3e85e2f63c1fa097b0f467/helm/solr/templates/solrcloud.yaml#L139
however the capacity is always set to 20Gi by default. I don't believe this is valid edge case where capacity is set to empty. however to make copilot you could add to line 131
{{- if (or .Values.dataStorage.capacity .Values.dataStorage.persistent.pvc.storageClassName
.Values.dataStorage.persistent.pvc.volumeAttributesClassName) }}
but not required since capacity should be always set
|
@coolstim please document the new parameter |
The volumeAttributesClassName attribute was already listed in the crd, but the helm chart did not pass it