Open Nalum opened 8 months ago
@stefanprodan with some feedback from the cue team I've gotten this so it now will print the definition of the field, see the README for the blueprints starter module. I want to refine the module so that name and namespace are not output, but wanted to bring it to your attention.
I'm still not getting what I want from the labels and annotations though :/
I have pulled and rebased the latest main, this behaves in the same way. I think the changes here are worth merging, I'll spend some time digging into cue releases since the initial work on this and see if I can get the result I initially wanted for annotations and labels.
Hey @Nalum with this we remove the default
column from the readme, would be possible to preserve it or we need to merge type with defaults? If so, I think we need to rename the type column to something else.
I removed it because the type information have use the type and the default in one result, ~I had not found a way to get both separately at the time, maybe there is a way now, I'll dig into that too.~ scratch that, it was doing this, I can't recall the reason for making that change now.
Do you want to hold off on merging this for now so?
Ah I think the goal was to show the cue type information as is. For example if we just had the type and default this would not show you the possible values:
| `test: startupAPICheck: service: type:` | `*"ClusterIP" \| "NodePort" \| "LoadBalancer" \| "ExternalName"` |
You would have this instead:
| `test: startupAPICheck: service: type:` | `string` | `ClusterIP` |
I guess this adds a requirement to understand cue syntax :thinking:
Based on feedback in https://github.com/cue-lang/cue/discussions/2783 this PR updates the Markdown document generation to pull the optional fields into the table data. This is done via the
cue.Value.Fields()
iterator.