Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having invalid options:version value on explicit provider causes conversion to produce incorrect output #702

Open
zbuchheit opened this issue Dec 13, 2024 · 4 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@zbuchheit
Copy link

What happened?

When attempting to use pulumi convert to generate additional examples from yaml to other languages, the other languages were missing the explicit provider.

Example

Source YAML
name: base
runtime: yaml

plugins:
  providers:
    - name: base
      path: ../../bin
resources:
  provider:
    type: pulumi:providers:base
    properties:
      accessToken: "accessToken123"
    options:
      version: 0.0.0-alpha.0 #Appending a "v" to the front of this actually makes it behave correctly
      pluginDownloadURL: https://testfakedownload
  my-account:
    type: base:Account
    properties:
      name: myaccount
    options:
      provider: ${provider}

outputs:
  myoutput: 
    fn::secret: ${my-account.secretValue}

Command used

pulumi convert --cwd ./examples/simple --language typescript --out ../test --logtostderr --generate-only --non-interactive

Generated Typescript
import * as pulumi from "@pulumi/pulumi";
import * as base from "@pulumi/base";

const provider = new base.Provider("provider", {accessToken: "accessToken123"});
const myAccount = new base.Account("my-account", {name: "myaccount"});
export const myoutput = pulumi.secret(myAccount.secretValue);

Output of pulumi about

CLI          
Version      3.143.0
yaml         converter  1.12.0 

Additional context

I actually think this maybe should fail some sort of validation rather than succeeding incorrectly. In my testing, removing version or appending v to the front of the string actually makes it behave as expected. For example version: v0.0.0-alpha.0

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).

@zbuchheit zbuchheit added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 13, 2024
@justinvp justinvp removed the needs-triage Needs attention from the triage team label Dec 16, 2024
@tgummerer tgummerer self-assigned this Dec 19, 2024
@tgummerer
Copy link
Contributor

@zbuchheit to make this a little easier to reproduce, could you share what the base provider here looks like?

@zbuchheit
Copy link
Author

@tgummerer like the schema or what do you mean here?

@zbuchheit
Copy link
Author

@tgummerer
Copy link
Contributor

This is exactly what I was looking for, and I can repro the issue now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants