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

Run CopyToRemote once #583

Open
yellowhat opened this issue Dec 4, 2024 · 4 comments
Open

Run CopyToRemote once #583

yellowhat opened this issue Dec 4, 2024 · 4 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

@yellowhat
Copy link

yellowhat commented Dec 4, 2024

What happened?

Hi,
I would like to upload a folder to a remote host but only once, successive changes to the source should be ignored.

From my understanding ignore_changes should be the option to enable:

remote.CopyToRemote(
    "foo",
    connection=conn,
    source=FileArchive("k8s"),
    remote_path="./",
    opts=ResourceOptions(ignore_changes=["source"]),
)

But I get the following error:

error: command:remote:CopyToRemote resource 'foo': property archive value {<nil>} has a problem: archive must be a path to a file or directory

Any suggestion?

Thanks

Output of pulumi about

CLI          
Version      3.142.0
Go Version   go1.23.3
Go Compiler  gc

Host     
OS       alpine
Version  3.20.3
Arch     x86_64

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

@yellowhat yellowhat added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 4, 2024
@mjeffryes
Copy link
Member

Hi @yellowhat, I tried reproducing this, but it worked just fine for me. Are you sure that k8s is a directory or an archive file type like tgz or zip?

@mjeffryes mjeffryes added awaiting-feedback Blocked on input from the author needs-repro Needs repro steps before it can be triaged or fixed and removed needs-triage Needs attention from the triage team labels Dec 7, 2024
@yellowhat
Copy link
Author

Interesting.

  • pulumi preview: does not show any error
  • pulumi preview --refresh: shows the error above

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Dec 7, 2024
@mjeffryes
Copy link
Member

mjeffryes commented Dec 9, 2024

Oh that clarifies things quite a bit, I can repro this now. Somehow the --refresh option is trying to set state for the source (which it can't do seeing as the archive is something local) and then that nil value is getting into the preview. (and there's some complication with ignoreChanges that makes this worse) Possibly we need to tweak the behavior of read for this resource.

@mjeffryes mjeffryes 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 needs-repro Needs repro steps before it can be triaged or fixed labels Dec 9, 2024
@mjeffryes
Copy link
Member

Note that this also fails if you call pulumi refresh and then pulumi preview separately

@mjeffryes mjeffryes added this to the 0.115 milestone Jan 17, 2025
@mikhailshilkov mikhailshilkov modified the milestones: 0.115, 0.114 Jan 31, 2025
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

4 participants