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

Missing required argument: The argument "template.0.spec.0.containers.0.image" #827

Closed
maxmoeschinger opened this issue Jun 10, 2022 · 9 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@maxmoeschinger
Copy link

What happened?

I am trying to setup a gcp.cloudrun.Service with the following ignoreChanges:

{
    ignoreChanges: ["template.spec.containers[0].image"],
},

When I try to update the cloudrun resource through pulumi and run pulumi up I get the following error:

Diagnostics:
  gcp:cloudrun:Service (bv-dashboard):
    error: gcp:cloudrun/service:Service resource 'bv-dashboard' has a problem: Missing required argument: The argument "template.0.spec.0.containers.0.image" is required, but no definition was found.. Examine values at 'Service.Template.Spec[0].Containers[0].WorkingDir'.

Steps to reproduce

  1. Create a gcp.cloudrun.Service with the following ignore changes: ["template.spec.containers[0].image"]
  2. Update the gcp.cloudrun.Service and run pulumi up
  3. Pulumi will fail with the error described above

Expected Behavior

I expect pulumi to actually ignore image changes so that I can have CD setup without having a diff every time i run pulumi up.

Actual Behavior

I got this error:

Diagnostics:
  gcp:cloudrun:Service (bv-dashboard):
    error: gcp:cloudrun/service:Service resource 'bv-dashboard' has a problem: Missing required argument: The argument "template.0.spec.0.containers.0.image" is required, but no definition was found.. Examine values at 'Service.Template.Spec[0].Containers[0].WorkingDir'.

Versions used

No response

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

@maxmoeschinger maxmoeschinger added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 10, 2022
@jkisk
Copy link

jkisk commented Jun 10, 2022

I believe the property needs to be designated in the code, and then again in the ignoreChanges section, if I'm understanding the issue correctly. Here are the docs on ignoreChanges: https://www.pulumi.com/docs/intro/concepts/resources/options/ignorechanges/

@jkisk jkisk removed the needs-triage Needs attention from the triage team label Jun 10, 2022
@maxmoeschinger
Copy link
Author

Yes, I have also set the image name. It can create the resource but updating doesn't work.

@stack72
Copy link
Contributor

stack72 commented Jun 13, 2022

Hi @maxmoeschinger

Please can you let us see a sample of your code here?

I am assuming it's similar to the following:

gcp.cloudrun.Service("test", {
  ...other config...,
  template: {
    spec: {
      containers: [{
        image: "" <-------- this is a required name and doesn't matter about ignoreChanges
      }]
    },
  },
})

If this is the case, then image is a required param regardless of using ignoreChanges

Paul

@maxmoeschinger
Copy link
Author

Here is a sample:

new gcp.cloudrun.Service(
    "my-service-name",
    {
        name: "my-service-name",
        location: "europe-west1",
        autogenerateRevisionName: true,
        template: {
            spec: {
                containers: [
                    {
                        image: "gcr.io/cloudrun/placeholder",
                    },
                ],
            },
        },
        traffics: [
            {
                latestRevision: true,
                percent: 100,
            },
        ],
    },
    {
        ignoreChanges: ["template.spec.containers[0].image"],
    },
)

@Frassle
Copy link
Member

Frassle commented Jun 15, 2022

I think there's a provider issue here that it's giving back a very strange error message, but I wonder if you've also misunderstood what ignoreChanges does? It looks like your after a feature like pulumi/pulumi#8953 where if a diff happens the UI doesn't show it. IgnoreChanges does not do that, it just ignores any new value passed and uses the last seen value instead.

@maxmoeschinger
Copy link
Author

No, I just want it to use the old value. I have CD setup for this service so I don't want pulumi updating the image.

@Frassle
Copy link
Member

Frassle commented Jun 17, 2022

Thanks for confirming that.

@VladAmos
Copy link

Any update on this? There is a very real functional need to fix this in that in a production environment you don't want to accidentally rollback, or forward if using the "latest" tag, a service because you rolled some other unrelated change.

@mikhailshilkov mikhailshilkov added the resolution/fixed This issue was fixed label Oct 26, 2023
@mikhailshilkov mikhailshilkov self-assigned this Oct 26, 2023
@mikhailshilkov
Copy link
Member

mikhailshilkov commented Oct 26, 2023

I'm trying to repro it today with the latest version of everything. Took this program:

new gcp.cloudrun.Service(
    "my-service-name",
    {
        name: "my-service-name",
        location: "europe-west1",
        autogenerateRevisionName: true,
        template: {
            spec: {
                containers: [
                    {
                        image: "gcr.io/cloudrun/placeholder",
                    },
                ],
            },
        },
        traffics: [
            {
                latestRevision: true,
                percent: 100,
            },
        ],
    },
    {
        ignoreChanges: ["template.spec.containers[0].image"],
    },
)
  1. Ran pulumi up to deploy it.
  2. Changed one value to latestRevision: false.
  3. Ran pulumi up to deploy it again.
  4. Tried updating image itself and got no diff.
  5. Updating both image and latestRevision was a success too.

Both deployments succeeded.

Since the issue is more than a year old, I'll assume it's fixed and will close it. Please let me know if my repro is incomplete.

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 resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

6 participants