Ensure 'helm repo add' is also not pollute on helmfile template
When having multiple helmfiles in one helmfile.d folder and multiple of them having repositories defined, the errors mention in #1749 still existed. Fixes #1749 (again) Signed-off-by: Matthias Baur <m.baur@syseleven.de>
This commit is contained in:
		
							parent
							
								
									4e58bd4c34
								
							
						
					
					
						commit
						1cf8814dc5
					
				| 
						 | 
					@ -240,6 +240,10 @@ func (a *App) Template(c TemplateConfigProvider) error {
 | 
				
			||||||
		// Live output should never be enabled for the "template" subcommand to avoid breaking `helmfile template | kubectl apply -f -`
 | 
							// Live output should never be enabled for the "template" subcommand to avoid breaking `helmfile template | kubectl apply -f -`
 | 
				
			||||||
		run.helm.SetEnableLiveOutput(false)
 | 
							run.helm.SetEnableLiveOutput(false)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Reset helm extra args to not pollute BuildDeps() and AddRepo() on subsequent helmfiles
 | 
				
			||||||
 | 
							// https://github.com/helmfile/helmfile/issues/1749
 | 
				
			||||||
 | 
							run.helm.SetExtraArgs()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		prepErr := run.withPreparedCharts("template", state.ChartPrepareOptions{
 | 
							prepErr := run.withPreparedCharts("template", state.ChartPrepareOptions{
 | 
				
			||||||
			SkipRepos:              c.SkipRefresh() || c.SkipDeps(),
 | 
								SkipRepos:              c.SkipRefresh() || c.SkipDeps(),
 | 
				
			||||||
			SkipRefresh:            c.SkipRefresh(),
 | 
								SkipRefresh:            c.SkipRefresh(),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1449,10 +1449,6 @@ func (st *HelmState) runHelmDepBuilds(helm helmexec.Interface, concurrency int,
 | 
				
			||||||
	//
 | 
						//
 | 
				
			||||||
	//    See https://github.com/roboll/helmfile/issues/1521
 | 
						//    See https://github.com/roboll/helmfile/issues/1521
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Reset helm extra args to not pollute BuildDeps() on subsequent helmfiles
 | 
					 | 
				
			||||||
	// https://github.com/helmfile/helmfile/issues/1749
 | 
					 | 
				
			||||||
	helm.SetExtraArgs()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, r := range builds {
 | 
						for _, r := range builds {
 | 
				
			||||||
		buildDepsFlags := getBuildDepsFlags(r)
 | 
							buildDepsFlags := getBuildDepsFlags(r)
 | 
				
			||||||
		if err := helm.BuildDeps(r.releaseName, r.chartPath, buildDepsFlags...); err != nil {
 | 
							if err := helm.BuildDeps(r.releaseName, r.chartPath, buildDepsFlags...); err != nil {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,7 @@
 | 
				
			||||||
 | 
					repositories:
 | 
				
			||||||
 | 
					- name: bitnami
 | 
				
			||||||
 | 
					  url: https://charts.bitnami.com/bitnami
 | 
				
			||||||
 | 
					
 | 
				
			||||||
releases:
 | 
					releases:
 | 
				
			||||||
  - name: test1
 | 
					  - name: test1
 | 
				
			||||||
    chart: ../../../../charts/raw
 | 
					    chart: ../../../../charts/raw
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,7 @@
 | 
				
			||||||
 | 
					repositories:
 | 
				
			||||||
 | 
					- name: prometheus-community
 | 
				
			||||||
 | 
					  url: https://prometheus-community.github.io/helm-charts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
releases:
 | 
					releases:
 | 
				
			||||||
  - name: test2
 | 
					  - name: test2
 | 
				
			||||||
    chart: ../../../../charts/raw
 | 
					    chart: ../../../../charts/raw
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue