-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable l2-resource-asset-archive test (#684)
This is a bit more of an involved change to get this test working. Making two major changes. Firstly, historically YAML would always send absolute paths instead of relative paths to the engine. This was wrong, the engine expects that paths should be relative so that we don't save absolute paths to the state file. Secondly, YAML would error if you tried to access what it considered "unsafe" paths. That was either paths that clearly accessed outside the Pulumi.yaml directory, or non-constant paths to the remote asset and archive types. This seems overly restrictive, none of our other languages try to protect the user like this and it seems reasonable to expect to be able to do similar filesystem accesses from YAML. --------- Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
- Loading branch information
Showing
11 changed files
with
54 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
component: runtime | ||
kind: Improvements | ||
body: Pass asset and archive paths as is to the engine | ||
time: 2024-11-15T14:00:42.874578613Z | ||
custom: | ||
PR: "684" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
cmd/pulumi-language-yaml/testdata/projects/l2-resource-asset-archive/Pulumi.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: l2-resource-asset-archive | ||
runtime: yaml | ||
main: subdir |
Binary file added
BIN
+10 KB
cmd/pulumi-language-yaml/testdata/projects/l2-resource-asset-archive/archive.tar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
cmd/pulumi-language-yaml/testdata/projects/l2-resource-asset-archive/folder/test.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data in a folder |
34 changes: 34 additions & 0 deletions
34
cmd/pulumi-language-yaml/testdata/projects/l2-resource-asset-archive/subdir/Main.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
resources: | ||
ass: | ||
type: asset-archive:AssetResource | ||
properties: | ||
value: | ||
fn::FileAsset: ../test.txt | ||
arc: | ||
type: asset-archive:ArchiveResource | ||
properties: | ||
value: | ||
fn::FileArchive: ../archive.tar | ||
dir: | ||
type: asset-archive:ArchiveResource | ||
properties: | ||
value: | ||
fn::FileArchive: ../folder | ||
assarc: | ||
type: asset-archive:ArchiveResource | ||
properties: | ||
value: | ||
fn::AssetArchive: | ||
string: | ||
fn::StringAsset: file contents | ||
file: | ||
fn::FileAsset: ../test.txt | ||
folder: | ||
fn::FileArchive: ../folder | ||
archive: | ||
fn::FileArchive: ../archive.tar | ||
remoteass: | ||
type: asset-archive:AssetResource | ||
properties: | ||
value: | ||
fn::RemoteAsset: https://raw.githubusercontent.com/pulumi/pulumi/master/cmd/pulumi-test-language/testdata/l2-resource-asset-archive/test.txt |
3 changes: 3 additions & 0 deletions
3
...-language-yaml/testdata/projects/l2-resource-asset-archive/subdir/sdks/asset-archive.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packageDeclarationVersion: 1 | ||
name: asset-archive | ||
version: 5.0.0 |
1 change: 1 addition & 0 deletions
1
cmd/pulumi-language-yaml/testdata/projects/l2-resource-asset-archive/test.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
text |
3 changes: 3 additions & 0 deletions
3
cmd/pulumi-language-yaml/testdata/sdks/asset-archive-5.0.0/asset-archive-5.0.0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packageDeclarationVersion: 1 | ||
name: asset-archive | ||
version: 5.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters