Skip to content

Type of jsonpath query results in workload resource mapping isn't well-defined #14

@sadlerap

Description

@sadlerap

Something I ran into with regards to workload resource mapping: I was working with mapping a CronJob, and I was trying to determine if we should fail when we have a path query of .spec.jobTemplate.spec.template.spec.containers (rather than .spec.jobTemplate.spec.template.spec.containers[*], which is based off of our default). The difference between these two is that the first gives an array of container objects, while the second returns the same results, albeit not boxed in an array (i.e. multiple return values).

Should implementations support both of these queries as equivalent alternatives, or is one of these more correct than the other?
The default path query uses .spec.template.spec.containers[*], which inclines me toward preferring the latter type of query. That said, I don't think there's anything preventing implementations from supporting both styles (aside from maintenance burden). The specification doesn't say anything about this, however.


Filing this here because this is largely related to implementation work, and I think this should be mentioned in the implementation guide. That said, it may require spec modifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions