Open ekristen opened 3 months ago
@ekristen thanks for raising this issue and helping to make Rancher better! I'm transferring this issue to the Rancher Dashboard repository for additional triage. Our team may reach out to you to gather more information as we work to reproduce.
CRD additionalPrinterColumns are converted into Rancher schema attributes.columns
. In the UI for tables without a custom list component we show those as columns.
Given the examples in description, and some examples that exercise other json path syntax, we need to confirm what happens to those attributes.columns values (are they correct / valid) and then how we fetch the cell value given the string (i think we already do some magic to convert $.metadata.field
kind of thing).
I've brought this in to 2.9.0 as we'll be making a lot more use of these in the near future
See shell/store/type-map.utils.ts
rowValueGetter
, that's the first breadcrumb. I was wrong through and the actual part that gets the value is ...
valueFor
-->get
get
is very vanilla
if ( !path.includes('.') ) {
return obj?.[path];
}
const parts = splitObjectPath(path);
for (let i = 0; i < parts.length; i++) {
if (!obj) {
return;
}
obj = obj[parts[i]];
}
return obj;
We need to confirm what kind of string the schema is providing and work out how to use it to get the required value from the object
@richard-cox Is this a must for 2.9.0?
Rancher Server Setup
Information about the Cluster
Describe the bug The UI will not render the values of labels and annotations from the metadata block when periods or slashes are involved leaving to missing fields in the rancher UI especially when it comes to CRDs.
To Reproduce Install any CRD that has additionalPrinterColumns that reference .metadata.labels or annotations with an annotation for example that has a period or slash in it.
Result
Empty fields in the UI.
Expected Result
The fields to be populated with the correct values.
Screenshots![Screenshot 2024-04-05 at 8 52 27 AM](https://github.com/rancher/rancher/assets/48329/6bbfcfea-2590-4995-8534-63504b935519)
Additional context
My guess it has to do with the escaping of the special characters that's breaking the UI from rendering them properly.