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

When providing image args with pulumi.Output throws an exception #133

Open
yenoromm opened this issue Aug 7, 2024 · 2 comments
Open

When providing image args with pulumi.Output throws an exception #133

yenoromm opened this issue Aug 7, 2024 · 2 comments
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec

Comments

@yenoromm
Copy link

yenoromm commented Aug 7, 2024

What happened?

When creating the resource with pulumi outputs, it fails with the following:
"Exception: setting args: copying input "cainjector": expected destination type to implement pulumi.Input or pulumi.Output, got string"

It happens for any image args not just cainjector

$ pulumi version

v3.124.0
$ pip show pulumi-kubernetes-cert-manager      
                                                                                                                                     
Name: pulumi_kubernetes_cert_manager
Version: 0.0.6
Summary: Strongly-typed Cert Manager installation
Home-page: https://pulumi.io
Author: 
Author-email: 
License: Apache-2.0
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: parver, pulumi, pulumi-kubernetes, semver
Required-by:

Example

The example below is what it should look like but the repository in each image arg is a pulumi output and that causes a failure

kubernetes_cert_manager.CertManager(
    "certManagerResource",
    install_crds = True,
    image = kubernetes_cert_manager.CertManagerImageArgs(
        repository = "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/controller",
        tag = "1.15.1"
    ),
    cainjector = kubernetes_cert_manager.CertManagerImageArgs(
        repository = "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/cainjector"
        tag = "1.15.1"
    ),
    startupapicheck = kubernetes_cert_manager.CertManagerImageArgs(
        repository = "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/startupapicheck"
        tag = "1.15.1"
    ),
    webhook = kubernetes_cert_manager.CertManagerImageArgs(
        repository = "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/webhook"
        tag = "1.15.1"
    )
)

Output of pulumi about

$ pulumi about

CLI          
Version      3.124.0
Go Version   go1.22.5
Go Compiler  gc

Host     
OS       darwin
Version  14.4
Arch     arm64

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/xxxxx
User           xxxxxx
Organizations  xxxxx
Token type     personal

Additional context

No response

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

@yenoromm yenoromm added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 7, 2024
@aureq
Copy link
Member

aureq commented Aug 10, 2024

@yenoromm and for anyone else who might be in a similar situation... As a temporary workaround, it's possible to use a Helm Release.

cert_manager_release = k8s.helm.v3.Release("cert-manager-release", k8s.helm.v3.ReleaseArgs(
    chart="cert-manager",
    version="v1.15.2",
    repository_opts=k8s.helm.v3.RepositoryOptsArgs(
        repo="https://charts.jetstack.io",
    ),
    namespace=cert_manager_namespace.metadata.name,
    values={
        "installCRDs": True,
        "image": {
            "repository": "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/controller",
            "tag": "1.15.2"
        },
        "cainjector": {
            "image": {
                "repository": "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/cainjector",
                "tag": "1.15.2"
            },
        },
        "startupapicheck": {
            "image": {
                "repository": "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/startupapicheck",
                "tag": "1.15.2"
            },
        },
        "webhook": {
            "image": {
                "repository": "123456789.dkr.ecr.ap-southeast-2.amazonaws.com/cert-manager/webhook",
                "tag": "1.15.2"
            },
        }
    })
)

@EronWright
Copy link
Contributor

@aureq thanks for the report and the workaround.

@EronWright EronWright added impact/usability Something that impacts users' ability to use the product easily and intuitively and removed needs-triage Needs attention from the triage team labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/usability Something that impacts users' ability to use the product easily and intuitively kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants