@@ -67,11 +67,11 @@ func Test_templateClient_GetFromConfigMap(t *testing.T) {
67
67
configClient config.Client
68
68
}
69
69
type args struct {
70
- configMapNamespace string
71
- configMapName string
72
- configMapDataKey string
73
- targetNamespace string
74
- listVariablesOnly bool
70
+ configMapNamespace string
71
+ configMapName string
72
+ configMapDataKey string
73
+ targetNamespace string
74
+ skipTemplateProcess bool
75
75
}
76
76
tests := []struct {
77
77
name string
@@ -87,11 +87,11 @@ func Test_templateClient_GetFromConfigMap(t *testing.T) {
87
87
configClient : configClient ,
88
88
},
89
89
args : args {
90
- configMapNamespace : "ns1" ,
91
- configMapName : "my-template" ,
92
- configMapDataKey : "prod" ,
93
- targetNamespace : "" ,
94
- listVariablesOnly : false ,
90
+ configMapNamespace : "ns1" ,
91
+ configMapName : "my-template" ,
92
+ configMapDataKey : "prod" ,
93
+ targetNamespace : "" ,
94
+ skipTemplateProcess : false ,
95
95
},
96
96
want : template ,
97
97
wantErr : false ,
@@ -103,11 +103,11 @@ func Test_templateClient_GetFromConfigMap(t *testing.T) {
103
103
configClient : configClient ,
104
104
},
105
105
args : args {
106
- configMapNamespace : "ns1" ,
107
- configMapName : "something-else" ,
108
- configMapDataKey : "prod" ,
109
- targetNamespace : "" ,
110
- listVariablesOnly : false ,
106
+ configMapNamespace : "ns1" ,
107
+ configMapName : "something-else" ,
108
+ configMapDataKey : "prod" ,
109
+ targetNamespace : "" ,
110
+ skipTemplateProcess : false ,
111
111
},
112
112
want : "" ,
113
113
wantErr : true ,
@@ -119,11 +119,11 @@ func Test_templateClient_GetFromConfigMap(t *testing.T) {
119
119
configClient : configClient ,
120
120
},
121
121
args : args {
122
- configMapNamespace : "ns1" ,
123
- configMapName : "my-template" ,
124
- configMapDataKey : "something-else" ,
125
- targetNamespace : "" ,
126
- listVariablesOnly : false ,
122
+ configMapNamespace : "ns1" ,
123
+ configMapName : "my-template" ,
124
+ configMapDataKey : "something-else" ,
125
+ targetNamespace : "" ,
126
+ skipTemplateProcess : false ,
127
127
},
128
128
want : "" ,
129
129
wantErr : true ,
@@ -135,7 +135,7 @@ func Test_templateClient_GetFromConfigMap(t *testing.T) {
135
135
136
136
processor := yaml .NewSimpleProcessor ()
137
137
tc := newTemplateClient (TemplateClientInput {tt .fields .proxy , tt .fields .configClient , processor })
138
- got , err := tc .GetFromConfigMap (tt .args .configMapNamespace , tt .args .configMapName , tt .args .configMapDataKey , tt .args .targetNamespace , tt .args .listVariablesOnly )
138
+ got , err := tc .GetFromConfigMap (tt .args .configMapNamespace , tt .args .configMapName , tt .args .configMapDataKey , tt .args .targetNamespace , tt .args .skipTemplateProcess )
139
139
if tt .wantErr {
140
140
g .Expect (err ).To (HaveOccurred ())
141
141
return
@@ -147,7 +147,7 @@ func Test_templateClient_GetFromConfigMap(t *testing.T) {
147
147
ConfigVariablesClient : configClient .Variables (),
148
148
Processor : processor ,
149
149
TargetNamespace : tt .args .targetNamespace ,
150
- ListVariablesOnly : tt .args .listVariablesOnly ,
150
+ SkipTemplateProcess : tt .args .skipTemplateProcess ,
151
151
})
152
152
g .Expect (err ).NotTo (HaveOccurred ())
153
153
g .Expect (got ).To (Equal (wantTemplate ))
@@ -308,9 +308,9 @@ func Test_templateClient_GetFromURL(t *testing.T) {
308
308
g .Expect (os .WriteFile (path , []byte (template ), 0600 )).To (Succeed ())
309
309
310
310
type args struct {
311
- templateURL string
312
- targetNamespace string
313
- listVariablesOnly bool
311
+ templateURL string
312
+ targetNamespace string
313
+ skipTemplateProcess bool
314
314
}
315
315
tests := []struct {
316
316
name string
@@ -321,19 +321,19 @@ func Test_templateClient_GetFromURL(t *testing.T) {
321
321
{
322
322
name : "Get from local file system" ,
323
323
args : args {
324
- templateURL : path ,
325
- targetNamespace : "" ,
326
- listVariablesOnly : false ,
324
+ templateURL : path ,
325
+ targetNamespace : "" ,
326
+ skipTemplateProcess : false ,
327
327
},
328
328
want : template ,
329
329
wantErr : false ,
330
330
},
331
331
{
332
332
name : "Get from GitHub" ,
333
333
args : args {
334
- templateURL : "https://github.com/kubernetes-sigs/cluster-api/blob/master/config/default/cluster-template.yaml" ,
335
- targetNamespace : "" ,
336
- listVariablesOnly : false ,
334
+ templateURL : "https://github.com/kubernetes-sigs/cluster-api/blob/master/config/default/cluster-template.yaml" ,
335
+ targetNamespace : "" ,
336
+ skipTemplateProcess : false ,
337
337
},
338
338
want : template ,
339
339
wantErr : false ,
@@ -351,7 +351,7 @@ func Test_templateClient_GetFromURL(t *testing.T) {
351
351
// override the github client factory
352
352
c .gitHubClientFactory = gitHubClientFactory
353
353
354
- got , err := c .GetFromURL (tt .args .templateURL , tt .args .targetNamespace , tt .args .listVariablesOnly )
354
+ got , err := c .GetFromURL (tt .args .templateURL , tt .args .targetNamespace , tt .args .skipTemplateProcess )
355
355
if tt .wantErr {
356
356
g .Expect (err ).To (HaveOccurred ())
357
357
return
@@ -364,7 +364,7 @@ func Test_templateClient_GetFromURL(t *testing.T) {
364
364
ConfigVariablesClient : configClient .Variables (),
365
365
Processor : processor ,
366
366
TargetNamespace : tt .args .targetNamespace ,
367
- ListVariablesOnly : tt .args .listVariablesOnly ,
367
+ SkipTemplateProcess : tt .args .skipTemplateProcess ,
368
368
})
369
369
g .Expect (err ).NotTo (HaveOccurred ())
370
370
g .Expect (got ).To (Equal (wantTemplate ))
0 commit comments