Skip to content

Commit

Permalink
Merge pull request #45 from ezgidemirel/fix-random-label-example
Browse files Browse the repository at this point in the history
Fix random label example
  • Loading branch information
ezgidemirel authored Dec 13, 2023
2 parents 433e6f8 + 8aecb3b commit 3207722
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions example/filesystem/templates.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ metadata:
gotemplating.fn.crossplane.io/composition-resource-name: test-user-{{ $i }}
labels:
testing.upbound.io/example-name: test-user-{{ $i }}
{{ if eq $.observed.resources nil }}
dummy: {{ randomChoice "foo" "bar" "baz" }}
{{ else }}
dummy: {{ ( index $.observed.resources ( print "test-user-" $i ) ).resource.metadata.labels.dummy }}
{{ end }}
dummy: {{ dig "resources" (print "test-user-" $i) "resource" "metadata" "labels" "dummy" ( randomChoice "foo" "bar" "baz" ) $.observed }}
spec:
forProvider: {}
---
Expand Down
6 changes: 1 addition & 5 deletions example/inline/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ spec:
{{ setResourceNameAnnotation (print "test-user-" $i) }}
labels:
testing.upbound.io/example-name: test-user-{{ $i }}
{{ if eq $.observed.resources nil }}
dummy: {{ randomChoice "foo" "bar" "baz" }}
{{ else }}
dummy: {{ ( index $.observed.resources ( print "test-user-" $i ) ).resource.metadata.labels.dummy }}
{{ end }}
dummy: {{ dig "resources" (print "test-user-" $i) "resource" "metadata" "labels" "dummy" ( randomChoice "foo" "bar" "baz" ) $.observed }}
spec:
forProvider: {}
---
Expand Down

0 comments on commit 3207722

Please sign in to comment.