Currently i am doing an preview operation in the a...
# general
c
Currently i am doing an preview operation in the automation api(golang) and the preview shows a diff for the image tag as expected: ~ tag : "0.0.12" => "0.0.11" but result is at the end is Ressource "1 unchanged" why is pulumi not recognizing this change and is redeploying the app on Up call? iam trying to update an app (https://www.pulumi.com/registry/packages/digitalocean/api-docs/app/#look-up)
e
Are you trying to lookup and change a resource in one update?
c
i will try to explain what iam doing 🙂 1. Creating new app with the golang automation api (https://www.pulumi.com/registry/packages/digitalocean/api-docs/app/#example-usage) including a lot of env app variables and health check configuration. I am assigning the app configuration to a pulumi.RunFunc variable and executing it later with Up. Before iam doing newstackinlinesource and setconfig. After the creation i am storing the cloud ressourc id in a postgres db for accessing later. This all is working as expected and i am getting a helathy app including a state in pulumi dashboard. 2. For Update i am using the lookup function (https://www.pulumi.com/registry/packages/digitalocean/api-docs/app/#look-up). The Lookup pulumi.RunFunc is configured like the new app i created in step 1 plus the stored cloud ressource id to address my already created app. Instead of using the newstackinlinesource iam using the selectinlinesource in this function. Rest is the same as in creation of the app. Unfortunately the diff on the Up function shows an change for example for the image tag which should be deployed but pulumi does not deploy it. Every time iam doing a change for example in my envs or something else pulumi is not updating my deployed app. Pulumi up is showing the change if i add the diff opt parameter httpPort : 3000 ~ image : { registryType: "DOCR" repository : "examplerepo" ~ tag : "0.0.12" => "0.0.10" } but the app is not updated and deployed new. Iam not using preview and update in one update.
ah and thank you ahead for taking time for my problem 🙂
l
It sounds like you have different chunks of code to manage one resource: one chunk if you cannot find it (new) and one chunk if you can (update). Is that right?
That is an imperative solution, but Pulumi is declarative and does not work that way. Just use the "new" chunk. Don't look up the existing resource. Pulumi figures out that the resource already exists, and just updates the bits that need to change.
c
thanks 🙂 I tried this before my get solution. But there was one problem. The NewApp creates all the environments variables for the app - all fine. But if i started the update process pulumi wants to change all the environment variables and if i execute this it runs in a timeout. What i understand is, that digital ocean app has another env order as pulumi. On creation the order is different as on update. And pulumi wants to order it new. Digital Ocean is ready after 1 sec because he sees no change and pulumi is doing update and after not sure a lot of minutes running in an timeout. i will attach some screen for explanation - i think this is not so easy to understand
First picture is my array for the env in code for creation and updating (it is the same function as you told), Second picture is the created order in digital ocean after creation process, Third pricture is what pulumi wants to do on update (order new) - runs in an timeout
this seems like a bug or?
e
That sounds like a normalisation bug. Can you raise an issue at https://github.com/pulumi/pulumi-digitalocean/issues
c
ok i will do 🙂