Skip to content

opm alpha render-template doesn't recognize schema in v1.62.0 #1889

@dhaiducek

Description

@dhaiducek

I'm getting:

$ opm alpha render-template basic
Error: creating template by type: unknown template schema: basic

In the code, it looks like GetSupportedTypes() is returning the last portion of the schema:

types = append(types, schema[strings.LastIndex(schema, ".")+1:])

But then the factory is just returning the schema, which is the full path rather than just the last portion:

r.factories[factory.Schema()] = factory

const schema string = "olm.template.basic"

So then GetTemplateByType() is trying to index by the full path, which doesn't match the shorter type:

factory, exists := r.factories[schema]

Perhaps this PR introduced the regression?

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