Skip to content

Commit

Permalink
re-add import statement for PklPoject for local make generate runs.
Browse files Browse the repository at this point in the history
Signed-off-by: Tim <[email protected]>
  • Loading branch information
Avarei committed Jul 13, 2024
1 parent 8af4df0 commit c7d1135
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ generate: pkl-resolve-hack pkl-resolve
pkl eval --working-dir $(PROJECT_DIR)hack/pklcrd -m ../../pkl/crossplane.contrib crd2module-composition-fix.pkl
pkl eval --working-dir $(PROJECT_DIR)pkl/crossplane.contrib.example -m crds xrds/ExampleXR.pkl
pkl eval --working-dir $(PROJECT_DIR)pkl/crossplane.contrib.example compositions/inline.pkl > $(PROJECT_DIR)example/inline/composition.yaml
pkl eval --working-dir $(PROJECT_DIR)pkl/crossplane.contrib.example compositions/uri.pkl > $(PROJECT_DIR)example/full/composition.yaml
pkl eval --working-dir $(PROJECT_DIR)pkl/crossplane.contrib.example $(EXAMPLE_PARAM) compositions/uri.pkl > $(PROJECT_DIR)example/full/composition.yaml
pkl eval --working-dir $(PROJECT_DIR)pkl/crossplane.contrib.example xrs/inline.pkl > $(PROJECT_DIR)example/inline/xr.yaml
pkl eval --working-dir $(PROJECT_DIR)pkl/crossplane.contrib.example xrs/uri.pkl > $(PROJECT_DIR)example/full/xr.yaml

Expand Down
2 changes: 1 addition & 1 deletion example/full/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ spec:
kind: Pkl
spec:
type: uri
uri: package://pkg.pkl-lang.org/github.com/crossplane-contrib/function-pkl/[email protected].0#/compositions/steps/full.pkl
uri: package://pkg.pkl-lang.org/github.com/crossplane-contrib/function-pkl/[email protected].1#/compositions/steps/full.pkl
step: pkl-template
4 changes: 0 additions & 4 deletions example/inline/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ spec:
resources {
["cm-minimal"] = new {
resource = new Object {
metadata {
name = "cm-one"
}
spec {
forProvider {
manifest = new ConfigMap {
metadata {
name = "cm-minimal"
namespace = "crossplane-system"
}
data {
Expand Down
8 changes: 7 additions & 1 deletion pkl/crossplane.contrib.example/compositions/uri.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ spec {
input = new Pkl {
spec {
type = "uri"
uri = reflect.Module(full).uri
uri =
let (uri = reflect.Module(full).uri)
if (uri.startsWith("file:"))
let (pkg = import("../PklProject").package)
pkg.baseUri + "@" + pkg.version + "#/compositions/steps/full.pkl"
else
uri
}
}
}
Expand Down

0 comments on commit c7d1135

Please sign in to comment.