Skip to content

Commit 67ea9dd

Browse files
committed
fix nit
1 parent bbe53c2 commit 67ea9dd

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

api/filters/replacement/replacement_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,6 +4511,8 @@ func TestValueInlineStructuredData(t *testing.T) {
45114511
kind: ConfigMap
45124512
metadata:
45134513
name: target-configmap
4514+
annotations:
4515+
hostname: www.example.com
45144516
data:
45154517
config.json: |-
45164518
{
@@ -4524,7 +4526,7 @@ data:
45244526
- source:
45254527
kind: ConfigMap
45264528
name: target-configmap
4527-
fieldPath: metadata.name
4529+
fieldPath: metadata.annotations.hostname
45284530
targets:
45294531
- select:
45304532
kind: ConfigMap
@@ -4535,11 +4537,13 @@ data:
45354537
kind: ConfigMap
45364538
metadata:
45374539
name: target-configmap
4540+
annotations:
4541+
hostname: www.example.com
45384542
data:
45394543
config.json: |-
45404544
{
45414545
"config": {
4542-
"hostname": "target-configmap",
4546+
"hostname": "www.example.com",
45434547
"id": "42"
45444548
}
45454549
}`,

kyaml/yaml/match.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ func (p *PathMatcher) doField(rn *RNode) (*RNode, error) {
138138
// lookup the field
139139
field, err := rn.Pipe(Get(p.Path[0]))
140140
if err != nil {
141-
// check error is an invalid kind error
142-
invalidKindErr := &InvalidNodeKindError{}
143-
if errors.As(err, &invalidKindErr) {
144-
// if the field is valid json or yaml, continue to lookup the next part of the path
145-
fmt.Print("-----------------------------\nOUTPUT: ", err)
146-
}
147141
return nil, err
148142
}
149143

0 commit comments

Comments
 (0)