Skip to content

Need a way to disable path parse for gen csv #2983

@aharbis

Description

@aharbis

Feature Request

Is your feature request related to a problem? Please describe.

Yes. The behavior is summarized in the doc:

The SDK also checks path elements against a list of well-known path to x-descriptor string mappings and either uses a match as x-descriptors, or does not set x-descriptors.

Describe the solution you'd like

However, if I have a path such as resources.requests.cpu (because we are wanting to manually define how resources are provided), and I declare this as a number through the specDescriptors, the SDK automatically adds the full urn:alm:descriptor:com.tectonic.ui:resourceRequirements descriptor on top of mine.

// Custom CPU
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors=true
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="CPU"
// +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:number,urn:alm:descriptor:com.tectonic.ui:fieldGroup:Custom Resources"
CPU int `json:"cpu,omitempty"`
- description: Custom CPU
  displayName: CPU
  path: resources.requests.cpu
  x-descriptors:
  - urn:alm:descriptor:com.tectonic.ui:fieldGroup:Custom Resources
  - urn:alm:descriptor:com.tectonic.ui:number
  - urn:alm:descriptor:com.tectonic.ui:resourceRequirements

Notice that the x-descriptors output has my fieldGroup and number defined, but then on top of that there is resourceRequirements. This means that in the OpenShift Console UI Edit Form view, the entire resourceRequirements component is rendered where I would expect a single box for a number.

I would like to be able to tell the SDK to not automatically parse the path or not make decisions about type without my telling it to do so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.olm-integrationIssue relates to the OLM integration

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions