File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ func MakeTransformerConfig(
60
60
// sortFields provides determinism in logging, tests, etc.
61
61
func (t * TransformerConfig ) sortFields () {
62
62
sort .Sort (t .NamePrefix )
63
+ sort .Sort (t .NameSuffix )
63
64
sort .Sort (t .NameSpace )
64
65
sort .Sort (t .CommonLabels )
65
66
sort .Sort (t .TemplateLabels )
Original file line number Diff line number Diff line change @@ -265,12 +265,14 @@ apiVersion: kustomize.config.k8s.io/v1beta1
265
265
kind: Kustomization
266
266
namePrefix: foo-
267
267
nameSuffix: -bar
268
+ namespace: ns1
268
269
resources:
269
270
- deployment.yaml
270
271
- config.yaml
271
272
- secret.yaml
272
273
configurations:
273
274
- name-prefix-rules.yaml
275
+ - name-suffix-rules.yaml
274
276
` )
275
277
th .WriteF ("/merge-config/name-prefix-rules.yaml" , `
276
278
namePrefix:
@@ -280,6 +282,15 @@ namePrefix:
280
282
- path: metadata/name
281
283
apiVersion: v1
282
284
kind: Secret
285
+ ` )
286
+ th .WriteF ("/merge-config/name-suffix-rules.yaml" , `
287
+ nameSuffix:
288
+ - path: metadata/name
289
+ apiVersion: v1
290
+ kind: ConfigMap
291
+ - path: metadata/name
292
+ apiVersion: v1
293
+ kind: Deployment
283
294
` )
284
295
th .WriteF ("/merge-config/deployment.yaml" , `
285
296
apiVersion: apps/v1
@@ -308,19 +319,22 @@ metadata:
308
319
"apiVersion" : "apps/v1" ,
309
320
"kind" : "Deployment" ,
310
321
"metadata" : map [string ]interface {}{
311
- "name" : "foo-deployment1-bar" ,
322
+ "name" : "foo-deployment1-bar" ,
323
+ "namespace" : "ns1" ,
312
324
},
313
325
}), resFactory .FromMapWithName ("config" , map [string ]interface {}{
314
326
"apiVersion" : "v1" ,
315
327
"kind" : "ConfigMap" ,
316
328
"metadata" : map [string ]interface {}{
317
- "name" : "config-bar" ,
329
+ "name" : "config-bar" ,
330
+ "namespace" : "ns1" ,
318
331
},
319
332
}), resFactory .FromMapWithName ("secret" , map [string ]interface {}{
320
333
"apiVersion" : "v1" ,
321
334
"kind" : "Secret" ,
322
335
"metadata" : map [string ]interface {}{
323
- "name" : "foo-secret-bar" ,
336
+ "name" : "foo-secret" ,
337
+ "namespace" : "ns1" ,
324
338
},
325
339
}),
326
340
}
You can’t perform that action at this time.
0 commit comments