Skip to content

extraObjects supports string value input, but schema forbids #320

Description

@joel-bluedata

templates/extra-manifests.yaml can handle an extraObject being supplied either as an object or a string:

{{ range .Values.extraObjects }}
---
{{ if typeIs "string" . }}
    {{- tpl . $ }}
{{- else }}
    {{- tpl (toYaml .) $ }}
{{- end }}
{{ end }}

The string-valued case is what you get e.g. if the extraObjects are being supplied via Helm set-file arguments. Also only string-valued template input will support Helm value substitution that is not inside a string within the template, such as a port number ... the toYaml invocation in the object-valued form will error on that situation.

However, values.schema.json only supports object-valued input:

        "extraObjects": {
            "type": "array",
            "items": {
                "type": "object"
            },
            "default": []
        },

So an attempt to provide string-valued extraObjects will be rejected.

In order to allow string input, it seems like the schema would instead need to be something like:

        "extraObjects": {
            "type": "array",
            "items": {
                "type": ["string","object"]
            },
            "default": []
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions