Skip to content

Commit 5ad14fb

Browse files
committed
Add comment to explain current issues with CopyToRemote
1 parent bb5e0ef commit 5ad14fb

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

components/command/filemanager.go

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ func (fm *FileManager) CopyFile(name string, localPath, remotePath pulumi.String
6868
return fm.runner.newCopyFile(name, localPath, remotePath, opts...)
6969
}
7070

71+
// CopyToRemoteFile copies a local file to a remote file. Under the hood it uses remote.CopyToRemote, so localPath will be converted to a File Asset, it breaks if the local path is not known at plan time.
72+
// Ideally it should replace CopyFile but it is not possible due to the limitation of CopyToRemote for now.
7173
func (fm *FileManager) CopyToRemoteFile(name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error) {
7274
return fm.command.NewCopyToRemoteFile(fm.runner, name, localPath, remotePath, opts...)
7375
}

components/command/osCommand.go

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type OSCommand interface {
3434
NewCopyToRemoteFile(runner Runner, name string, localPath, remotePath pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)
3535
copyLocalFile(runner *LocalRunner, name string, src, dst pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)
3636
copyRemoteFile(runner *RemoteRunner, name string, src, dst pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)
37+
// copyToRemoteFileV2 rely on CopyToRemote to copy files to remote, which uses a File asset instead of a Pulumi.StringInput with the path. It breaks when the path is not determined at runtime.
3738
copyRemoteFileV2(runner *RemoteRunner, name string, src, dst pulumi.StringInput, opts ...pulumi.ResourceOption) (pulumi.Resource, error)
3839
}
3940

0 commit comments

Comments
 (0)