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

Add support for asset (StringAsset) as file parameter to kubernetes.yaml.v2.ConfigFile #3174

Open
ecerulm opened this issue Aug 16, 2024 · 0 comments
Labels
kind/enhancement Improvements or new features

Comments

@ecerulm
Copy link

ecerulm commented Aug 16, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

It would be nice if kubernetes.yaml.v2.ConfigFile would allow assets (specifically pulumi.StringAsset) to be passed in the file parameter.

that way I could have an output that render yaml via jinja2 and returns an StringAsset and pass it to ConfigFile like this

config_file = pulumi.Output.all(arg1=resource1.arn, arg2=resource2.arn).apply(lambda args: pulumi.StringAsset(template.render(args)))

# https://www.pulumi.com/registry/packages/kubernetes/api-docs/yaml/v2/configfile/#kubernetes-yaml-v2-configfile
kubernetes.yaml.v2.ConfigFile(
    "test",
    file=config_file,
    opts=pulumi.ResourceOptions(
        provider=kubernetes_provider,
    ),
)

the above code now raises

 Exception: setting args: copying input "file": expected a pulumi.String, got a asset

To me there are two possible solutions

  • allow file= to be a file-like object , or StringAsset in addition to the str (file-path)
  • introduce a new parameter to ConfigFile like content= where you can pass the computed manifest
  • Add a new concept like kubernetes.yaml.v2.Manifest() where we can pass the manifest content without having a file (allowing the manifest content to be a computed string )

Affected area/feature

@ecerulm ecerulm added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Aug 16, 2024
@EronWright EronWright transferred this issue from pulumi/pulumi Aug 16, 2024
@blampe blampe removed the needs-triage Needs attention from the triage team label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants