Skip to content

Commit

Permalink
WIP - failing test for map overlay position
Browse files Browse the repository at this point in the history
- need to build in a way to test line positions `template_test.go`
- run this test with `./hack/test-unit.sh -run TestYAMLTemplate
  TestYAMLTemplate.filetest=filetests/ytt-library/overlay/replace-key-position`
  • Loading branch information
cari-lynn committed Apr 1, 2021
1 parent 553ef49 commit 701a3b3
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:template", "template")

#@ def/end test1_left():
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress1
annotations:
key: 1

#@ def/end test1_right():
#@overlay/match by=overlay.all
---
metadata:
annotations:
key: 2

---
test1
--- #@ template.replace(overlay.apply(test1_left(), test1_right()))
---
+++

ASSERT LINE NUM:

stdin:20 | [doc]
| test1
stdin:5 | [doc]
stdin:6 | apiVersion: extensions/v1beta1
stdin:7 | kind: Ingress
stdin:16 | metadata:
stdin:9 | name: example-ingress1
stdin:17 | annotations:
stdin:18 | key: 2

0 comments on commit 701a3b3

Please sign in to comment.