Skip to content

PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression #1805

@blampe

Description

@blampe

What happened?

Similar to #1354 and #1349.

Example

  1. Clone the pulumi-docker-build repo and navigate towards this example YAML: https://github.com/pulumi/pulumi-docker-build/blob/main/examples/yaml/Pulumi.yaml

  2. Generate Java from the YAML:

pulumi convert \
    --logtostderr \
    --generate-only \
    --non-interactive \
    --language java \
    --generate-only \
    --non-interactive \
    --out java
  1. Observe the generated SDK includes a panic:
❯ rg PANIC
java/src/main/java/generated_program/App.java
157:%!v(PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression)))

Output of pulumi about

❯ pulumi about
CLI
Version 3.169.0
Go Version go1.24.3
Go Compiler gc

Plugins
KIND NAME VERSION
resource docker-build unknown
language yaml 1.19.0

Host
OS darwin
Version 15.4.1
Arch arm64

This project is written in yaml

Backend
Name pulumi.com
URL https://app.pulumi.com/bryce-pulumi-corp
User bryce-pulumi-corp
Organizations bryce-pulumi-corp, pulumi
Token type personal

Dependencies:
NAME VERSION
docker-build

Pulumi locates its logs in /var/folders/kq/zdlx0fn57yl66gxktcyzylv40000gn/T/ by default
warning: Failed to get information about the current stack: No current stack

Additional context

More of the generated SDK output:

        var namedContexts = new Image("namedContexts", ImageArgs.builder()
            .push(false)
            .dockerfile(DockerfileArgs.builder()
                .location("./app/Dockerfile.namedContexts")
                .build())
            .context(BuildContextArgs.builder()
                .location("./app")
                .named(Map.of(k1: "golang:latest", ContextArgs.builder()
%!v(PANIC=Format method: interface conversion: model.Expression is *model.TemplateExpression, not *model.LiteralValueExpression)))
                    .build())
                .build());

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/codegenCode generationkind/bugSome behavior is incorrect or out of spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions