File tree Expand file tree Collapse file tree 6 files changed +50
-9
lines changed Expand file tree Collapse file tree 6 files changed +50
-9
lines changed Original file line number Diff line number Diff line change @@ -33,21 +33,23 @@ func TestScreeningLocalReader(t *testing.T) {
33
33
}
34
34
nodes , err := r .Read ()
35
35
g .Expect (err ).ToNot (HaveOccurred ())
36
- // the test fixture has three files that contain the marker:
37
- // - otherns.yaml
36
+ // the test fixture has four files that contain the marker:
38
37
// - marked.yaml
39
- // - kustomization.yaml
40
- g .Expect (len (nodes )).To (Equal (3 ))
38
+ // - otherns.yaml
39
+ // - kustomization.yml
40
+ // - Kustomization
41
+ g .Expect (len (nodes )).To (Equal (4 ))
41
42
filesSeen := map [string ]struct {}{}
42
43
for i := range nodes {
43
44
path , _ , err := kioutil .GetFileAnnotations (nodes [i ])
44
45
g .Expect (err ).ToNot (HaveOccurred ())
45
46
filesSeen [path ] = struct {}{}
46
47
}
47
48
g .Expect (filesSeen ).To (Equal (map [string ]struct {}{
48
- "marked.yaml" : {},
49
- "kustomization.yaml" : {},
50
- "otherns.yaml" : {},
49
+ "marked.yaml" : {},
50
+ "otherns.yaml" : {},
51
+ "kustomization.yml" : {},
52
+ "Kustomization" : {},
51
53
}))
52
54
53
55
}
Original file line number Diff line number Diff line change
1
+ # This is not intended to be a working kustomization
2
+ apiVersion: kustomize.config.k8s.io/v1beta1
3
+ kind: Kustomization
4
+ resources:
5
+ - irrelevant.yaml
6
+ images:
7
+ - name: container
8
+ newName: index.repo.fake/updated # {"$imagepolicy": "automation-ns:policy:name"}
9
+ newTag: v1.0.1 # {"$imagepolicy": "automation-ns:policy:tag"}
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # This is not intended to be a working kustomization
2
+ apiVersion: kustomize.config.k8s.io/v1beta1
3
+ kind: Kustomization
4
+ resources:
5
+ - irrelevant.yaml
6
+ images:
7
+ - name: container
8
+ newName: replaced # {"$imagepolicy": "automation-ns:policy:name"}
9
+ newTag: v1 # {"$imagepolicy": "automation-ns:policy:tag"}
File renamed without changes.
Original file line number Diff line number Diff line change @@ -83,7 +83,14 @@ func TestUpdateWithSetters(t *testing.T) {
83
83
84
84
expectedResult := Result {
85
85
Files : map [string ]FileResult {
86
- "kustomization.yaml" : {
86
+ "kustomization.yml" : {
87
+ Objects : map [ObjectIdentifier ][]ImageRef {
88
+ kustomizeResourceID : {
89
+ expectedImageRef ,
90
+ },
91
+ },
92
+ },
93
+ "Kustomization" : {
87
94
Objects : map [ObjectIdentifier ][]ImageRef {
88
95
kustomizeResourceID : {
89
96
expectedImageRef ,
@@ -111,7 +118,21 @@ func TestUpdateWithSetters(t *testing.T) {
111
118
expectedResultV2 := ResultV2 {
112
119
ImageResult : expectedResult ,
113
120
FileChanges : map [string ]ObjectChanges {
114
- "kustomization.yaml" : {
121
+ "kustomization.yml" : {
122
+ kustomizeResourceID : []Change {
123
+ {
124
+ OldValue : "replaced" ,
125
+ NewValue : "index.repo.fake/updated" ,
126
+ Setter : "automation-ns:policy:name" ,
127
+ },
128
+ {
129
+ OldValue : "v1" ,
130
+ NewValue : "v1.0.1" ,
131
+ Setter : "automation-ns:policy:tag" ,
132
+ },
133
+ },
134
+ },
135
+ "Kustomization" : {
115
136
kustomizeResourceID : []Change {
116
137
{
117
138
OldValue : "replaced" ,
You can’t perform that action at this time.
0 commit comments