@@ -99,11 +99,11 @@ func expandApplicationSource(_ass []interface{}, featureApplicationSourceNameSup
9999 s .Chart = v .(string )
100100 }
101101
102- if v , ok := as ["helm" ]; ok && v != nil {
102+ if v , ok := as ["helm" ]; ok {
103103 s .Helm = expandApplicationSourceHelm (v .([]interface {}))
104104 }
105105
106- if v , ok := as ["kustomize" ]; ok && v != nil {
106+ if v , ok := as ["kustomize" ]; ok {
107107 s .Kustomize = expandApplicationSourceKustomize (v .([]interface {}))
108108 }
109109
@@ -214,59 +214,60 @@ func expandApplicationSourceKustomize(in []interface{}) *application.Application
214214
215215 result := & application.ApplicationSourceKustomize {}
216216
217- a := in [0 ].(map [string ]interface {})
218- if v , ok := a ["name_prefix" ]; ok {
219- result .NamePrefix = v .(string )
220- }
217+ if a , ok := in [0 ].(map [string ]interface {}); ok {
218+ if v , ok := a ["name_prefix" ]; ok {
219+ result .NamePrefix = v .(string )
220+ }
221221
222- if v , ok := a ["name_suffix" ]; ok {
223- result .NameSuffix = v .(string )
224- }
222+ if v , ok := a ["name_suffix" ]; ok {
223+ result .NameSuffix = v .(string )
224+ }
225225
226- if v , ok := a ["version" ]; ok {
227- result .Version = v .(string )
228- }
226+ if v , ok := a ["version" ]; ok {
227+ result .Version = v .(string )
228+ }
229229
230- if v , ok := a ["images" ]; ok {
231- for _ , i := range v .(* schema.Set ).List () {
232- result .Images = append (result .Images , application .KustomizeImage (i .(string )))
230+ if v , ok := a ["images" ]; ok {
231+ for _ , i := range v .(* schema.Set ).List () {
232+ result .Images = append (result .Images , application .KustomizeImage (i .(string )))
233+ }
233234 }
234- }
235235
236- if cls , ok := a ["common_labels" ]; ok {
237- result .CommonLabels = make (map [string ]string , 0 )
236+ if cls , ok := a ["common_labels" ]; ok {
237+ result .CommonLabels = make (map [string ]string , 0 )
238238
239- for k , v := range cls .(map [string ]interface {}) {
240- result .CommonLabels [k ] = v .(string )
239+ for k , v := range cls .(map [string ]interface {}) {
240+ result .CommonLabels [k ] = v .(string )
241+ }
241242 }
242- }
243243
244- if cas , ok := a ["common_annotations" ]; ok {
245- result .CommonAnnotations = make (map [string ]string , 0 )
244+ if cas , ok := a ["common_annotations" ]; ok {
245+ result .CommonAnnotations = make (map [string ]string , 0 )
246246
247- for k , v := range cas .(map [string ]interface {}) {
248- result .CommonAnnotations [k ] = v .(string )
247+ for k , v := range cas .(map [string ]interface {}) {
248+ result .CommonAnnotations [k ] = v .(string )
249+ }
249250 }
250- }
251251
252- if patches , ok := a ["patches" ]; ok {
253- for _ , v := range patches .([]interface {}) {
254- patchMap := v .(map [string ]interface {})
255- kustomizePatch := application.KustomizePatch {}
252+ if patches , ok := a ["patches" ]; ok {
253+ for _ , v := range patches .([]interface {}) {
254+ patchMap := v .(map [string ]interface {})
255+ kustomizePatch := application.KustomizePatch {}
256256
257- if patch , ok := patchMap ["patch" ]; ok {
258- kustomizePatch .Patch = patch .(string )
259- }
257+ if patch , ok := patchMap ["patch" ]; ok {
258+ kustomizePatch .Patch = patch .(string )
259+ }
260260
261- if target , ok := patchMap ["target" ]; ok {
262- kustomizePatch .Target = expandApplicationSourceKustomizePatchTarget (target .([]interface {}))
263- }
261+ if target , ok := patchMap ["target" ]; ok {
262+ kustomizePatch .Target = expandApplicationSourceKustomizePatchTarget (target .([]interface {}))
263+ }
264264
265- if options , ok := patchMap ["options" ]; ok {
266- kustomizePatch .Options = expandBoolMap (options .(map [string ]interface {}))
267- }
265+ if options , ok := patchMap ["options" ]; ok {
266+ kustomizePatch .Options = expandBoolMap (options .(map [string ]interface {}))
267+ }
268268
269- result .Patches = append (result .Patches , kustomizePatch )
269+ result .Patches = append (result .Patches , kustomizePatch )
270+ }
270271 }
271272 }
272273
@@ -324,75 +325,76 @@ func expandApplicationSourceHelm(in []interface{}) *application.ApplicationSourc
324325
325326 result := & application.ApplicationSourceHelm {}
326327
327- a := in [0 ].(map [string ]interface {})
328- if v , ok := a ["value_files" ]; ok {
329- for _ , vf := range v .([]interface {}) {
330- result .ValueFiles = append (result .ValueFiles , vf .(string ))
328+ if a , ok := in [0 ].(map [string ]interface {}); ok {
329+ if v , ok := a ["value_files" ]; ok {
330+ for _ , vf := range v .([]interface {}) {
331+ result .ValueFiles = append (result .ValueFiles , vf .(string ))
332+ }
331333 }
332- }
333334
334- if v , ok := a ["values" ]; ok {
335- result .Values = v .(string )
336- }
335+ if v , ok := a ["values" ]; ok {
336+ result .Values = v .(string )
337+ }
337338
338- if v , ok := a ["release_name" ]; ok {
339- result .ReleaseName = v .(string )
340- }
339+ if v , ok := a ["release_name" ]; ok {
340+ result .ReleaseName = v .(string )
341+ }
341342
342- if v , ok := a ["pass_credentials" ]; ok {
343- result .PassCredentials = v .(bool )
344- }
343+ if v , ok := a ["pass_credentials" ]; ok {
344+ result .PassCredentials = v .(bool )
345+ }
345346
346- if v , ok := a ["ignore_missing_value_files" ]; ok {
347- result .IgnoreMissingValueFiles = v .(bool )
348- }
347+ if v , ok := a ["ignore_missing_value_files" ]; ok {
348+ result .IgnoreMissingValueFiles = v .(bool )
349+ }
349350
350- if parameters , ok := a ["parameter" ]; ok {
351- for _ , _p := range parameters .(* schema.Set ).List () {
352- p := _p .(map [string ]interface {})
351+ if parameters , ok := a ["parameter" ]; ok {
352+ for _ , _p := range parameters .(* schema.Set ).List () {
353+ p := _p .(map [string ]interface {})
353354
354- parameter := application.HelmParameter {}
355+ parameter := application.HelmParameter {}
355356
356- if v , ok := p ["force_string" ]; ok {
357- parameter .ForceString = v .(bool )
358- }
357+ if v , ok := p ["force_string" ]; ok {
358+ parameter .ForceString = v .(bool )
359+ }
359360
360- if v , ok := p ["name" ]; ok {
361- parameter .Name = v .(string )
362- }
361+ if v , ok := p ["name" ]; ok {
362+ parameter .Name = v .(string )
363+ }
363364
364- if v , ok := p ["value" ]; ok {
365- parameter .Value = v .(string )
366- }
365+ if v , ok := p ["value" ]; ok {
366+ parameter .Value = v .(string )
367+ }
367368
368- result .Parameters = append (result .Parameters , parameter )
369+ result .Parameters = append (result .Parameters , parameter )
370+ }
369371 }
370- }
371372
372- if fileParameters , ok := a ["file_parameter" ]; ok {
373- for _ , _p := range fileParameters .(* schema.Set ).List () {
374- p := _p .(map [string ]interface {})
373+ if fileParameters , ok := a ["file_parameter" ]; ok {
374+ for _ , _p := range fileParameters .(* schema.Set ).List () {
375+ p := _p .(map [string ]interface {})
375376
376- parameter := application.HelmFileParameter {}
377+ parameter := application.HelmFileParameter {}
377378
378- if v , ok := p ["name" ]; ok {
379- parameter .Name = v .(string )
380- }
379+ if v , ok := p ["name" ]; ok {
380+ parameter .Name = v .(string )
381+ }
381382
382- if v , ok := p ["path" ]; ok {
383- parameter .Path = v .(string )
384- }
383+ if v , ok := p ["path" ]; ok {
384+ parameter .Path = v .(string )
385+ }
385386
386- result .FileParameters = append (result .FileParameters , parameter )
387+ result .FileParameters = append (result .FileParameters , parameter )
388+ }
387389 }
388- }
389390
390- if v , ok := a ["skip_crds" ]; ok {
391- result .SkipCrds = v .(bool )
392- }
391+ if v , ok := a ["skip_crds" ]; ok {
392+ result .SkipCrds = v .(bool )
393+ }
393394
394- if v , ok := a ["version" ]; ok {
395- result .Version = v .(string )
395+ if v , ok := a ["version" ]; ok {
396+ result .Version = v .(string )
397+ }
396398 }
397399
398400 return result
0 commit comments