Hi, I'm seeing a super-weird behaviour. I wanted t...
# general
h
Hi, I'm seeing a super-weird behaviour. I wanted to change a path in a resource property from "./assets/logo.png" to
${__dirname}/../assets/logo.png
. it's pointing to the same location, just didn't want a relative path. a side-problem is that it's Zitadel provider, which is a total mess, and it doesn't work. So I wanted to rollback. Now when I run
pulumi up
with the new path, the diff shows
Copy code
~ zitadel:index/labelPolicy:LabelPolicy: (update)
    [id=231695030580995897]
    ~ iconPath           : "./assets/logo.png" => "${project root}/assets/logo.png"
but if DON'T approve, rollback the change in source code and run
pulumi up
again, it shows
Copy code
~ zitadel:index/labelPolicy:LabelPolicy: (update)
    [id=231695030580995897]
    ~ iconPath    : "${project root}/assets/logo.png" => "./assets/logo.png"
They can't be both right. I can't refresh either because of https://github.com/pulumiverse/pulumi-zitadel/issues/31 I'm stuck
I've dumped the stack and it shows the relative path in resource inputs and the absolute paths in outputs
I guess I just edit and import back the stack dump
e
So you generally want to use relative paths because it stops diffs if you just move the folder around your machine (or onto other machines). The diffs are odd, I'd guess it's reporting both the input diff and the output diff so either way it says there's a difference. Odd that the state saved didn't match up though? I guess that's towards your comment that the change didn't work properly in the first instance.
h
I was using relative paths originally and I was attempting to use full path with a special file with
const projectRoot = __dirname
, but that didn't work out well, because __dirname has a full absolute path, so it's not portable at all, and breaks state (reports state change if run on different machine). I wanted to avoid relative path, because it's relative to where I run
pulumi
instead or project root
e
relative path should be fine, pulumi always changes the working directory to the location of your Pulumi.yaml file (or other directory set by
main
in the Pulumi.yaml) before running your program
1