Fix destory, delete, and test to work with chartify on local chart with dependencies that are not yet downloaded (#1801)
Fixes #1800
This commit is contained in:
		
							parent
							
								
									ce6a621414
								
							
						
					
					
						commit
						5a3bd7d649
					
				
							
								
								
									
										12
									
								
								main.go
								
								
								
								
							
							
						
						
									
										12
									
								
								main.go
								
								
								
								
							|  | @ -554,6 +554,10 @@ func main() { | |||
| 					Name:  "purge", | ||||
| 					Usage: "purge releases i.e. free release names and histories", | ||||
| 				}, | ||||
| 				cli.BoolFlag{ | ||||
| 					Name:  "skip-deps", | ||||
| 					Usage: `skip running "helm repo update" and "helm dependency build"`, | ||||
| 				}, | ||||
| 			}, | ||||
| 			Action: action(func(a *app.App, c configImpl) error { | ||||
| 				return a.Delete(c) | ||||
|  | @ -573,6 +577,10 @@ func main() { | |||
| 					Value: "", | ||||
| 					Usage: "pass args to helm exec", | ||||
| 				}, | ||||
| 				cli.BoolFlag{ | ||||
| 					Name:  "skip-deps", | ||||
| 					Usage: `skip running "helm repo update" and "helm dependency build"`, | ||||
| 				}, | ||||
| 			}, | ||||
| 			Action: action(func(a *app.App, c configImpl) error { | ||||
| 				return a.Destroy(c) | ||||
|  | @ -605,6 +613,10 @@ func main() { | |||
| 					Value: 0, | ||||
| 					Usage: "maximum number of concurrent helm processes to run, 0 is unlimited", | ||||
| 				}, | ||||
| 				cli.BoolFlag{ | ||||
| 					Name:  "skip-deps", | ||||
| 					Usage: `skip running "helm repo update" and "helm dependency build"`, | ||||
| 				}, | ||||
| 			}, | ||||
| 			Action: action(func(a *app.App, c configImpl) error { | ||||
| 				return a.Test(c) | ||||
|  |  | |||
|  | @ -396,8 +396,8 @@ func (a *App) Status(c StatusesConfigProvider) error { | |||
| func (a *App) Delete(c DeleteConfigProvider) error { | ||||
| 	return a.ForEachState(func(run *Run) (ok bool, errs []error) { | ||||
| 		err := run.withPreparedCharts("delete", state.ChartPrepareOptions{ | ||||
| 			SkipRepos: true, | ||||
| 			SkipDeps:  true, | ||||
| 			SkipRepos: c.SkipDeps(), | ||||
| 			SkipDeps:  c.SkipDeps(), | ||||
| 		}, func() { | ||||
| 			ok, errs = a.delete(run, c.Purge(), c) | ||||
| 		}) | ||||
|  | @ -413,8 +413,8 @@ func (a *App) Delete(c DeleteConfigProvider) error { | |||
| func (a *App) Destroy(c DestroyConfigProvider) error { | ||||
| 	return a.ForEachState(func(run *Run) (ok bool, errs []error) { | ||||
| 		err := run.withPreparedCharts("destroy", state.ChartPrepareOptions{ | ||||
| 			SkipRepos: true, | ||||
| 			SkipDeps:  true, | ||||
| 			SkipRepos: c.SkipDeps(), | ||||
| 			SkipDeps:  c.SkipDeps(), | ||||
| 		}, func() { | ||||
| 			ok, errs = a.delete(run, true, c) | ||||
| 		}) | ||||
|  | @ -436,8 +436,8 @@ func (a *App) Test(c TestConfigProvider) error { | |||
| 		} | ||||
| 
 | ||||
| 		err := run.withPreparedCharts("test", state.ChartPrepareOptions{ | ||||
| 			SkipRepos: true, | ||||
| 			SkipDeps:  true, | ||||
| 			SkipRepos: c.SkipDeps(), | ||||
| 			SkipDeps:  c.SkipDeps(), | ||||
| 		}, func() { | ||||
| 			errs = a.test(run, c) | ||||
| 		}) | ||||
|  |  | |||
|  | @ -114,6 +114,7 @@ type DeleteConfigProvider interface { | |||
| 	Args() string | ||||
| 
 | ||||
| 	Purge() bool | ||||
| 	SkipDeps() bool | ||||
| 
 | ||||
| 	interactive | ||||
| 	loggingConfig | ||||
|  | @ -123,6 +124,8 @@ type DeleteConfigProvider interface { | |||
| type DestroyConfigProvider interface { | ||||
| 	Args() string | ||||
| 
 | ||||
| 	SkipDeps() bool | ||||
| 
 | ||||
| 	interactive | ||||
| 	loggingConfig | ||||
| 	concurrencyConfig | ||||
|  | @ -131,6 +134,7 @@ type DestroyConfigProvider interface { | |||
| type TestConfigProvider interface { | ||||
| 	Args() string | ||||
| 
 | ||||
| 	SkipDeps() bool | ||||
| 	Timeout() int | ||||
| 	Cleanup() bool | ||||
| 	Logs() bool | ||||
|  |  | |||
|  | @ -26,6 +26,7 @@ type destroyConfig struct { | |||
| 	args        string | ||||
| 	concurrency int | ||||
| 	interactive bool | ||||
| 	skipDeps    bool | ||||
| 	logger      *zap.SugaredLogger | ||||
| } | ||||
| 
 | ||||
|  | @ -45,6 +46,10 @@ func (d destroyConfig) Concurrency() int { | |||
| 	return d.concurrency | ||||
| } | ||||
| 
 | ||||
| func (d destroyConfig) SkipDeps() bool { | ||||
| 	return d.skipDeps | ||||
| } | ||||
| 
 | ||||
| func TestDestroy(t *testing.T) { | ||||
| 	type testcase struct { | ||||
| 		helm3       bool | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue