This message was deleted.
# golang
s
This message was deleted.
s
Notice the
sleeping for a min
occurs 1st which means every
up
fails to process the new command because the sleep happens first? I don't understand how the execution order is altered?
I've dropped a few fmt.Println's around to confirm that the Go is executed in the correct order, so now I need to figure out how Pulumi determines the plan order to execute and why it wants to run the remoteCommand on the instance before the instance is created. Even with the dependsOn
For fun I ran an infinite for loop on an ApplyT on the instance already created. Turns out the "status" will change so there's definitely more happening behind the scenes. Pulumi must be making requests on my behalf to check the status, so I have no need to Get an instance and "wait". Learning....stay tuned
Ok so I have my remote.Command running on my new instance. I create a linode.NewInstance, then in another method I "wait" for the instance.Status to equal the status I want in an ApplyT on the status pulumi.StringOutput field. My ApplyT method closes a context.WithTimeOut chan when the status equals so code execution continues, otherwise an err is returned on Deadline exceeded. Being my first play with Pulumi, I thought that I needed to make a specific GetInstance request and check the Instance status. It would seem that Pulumi "knows" that I have an ApplyT on an instance field, and makes the required requests for me to run the ApplyT on change. Which is kinda magic and wasn't intuitive to me. Happily learning here 👍