feat: Automatically update repos on diffing by default (#462)
Resolves #452
This commit is contained in:
		
							parent
							
								
									fb256b0161
								
							
						
					
					
						commit
						b894012c80
					
				
							
								
								
									
										9
									
								
								main.go
								
								
								
								
							
							
						
						
									
										9
									
								
								main.go
								
								
								
								
							|  | @ -170,7 +170,11 @@ func main() { | ||||||
| 				}, | 				}, | ||||||
| 				cli.BoolFlag{ | 				cli.BoolFlag{ | ||||||
| 					Name:  "sync-repos", | 					Name:  "sync-repos", | ||||||
| 					Usage: "enable a repo sync prior to diffing", | 					Usage: "DEPRECATED", | ||||||
|  | 				}, | ||||||
|  | 				cli.BoolFlag{ | ||||||
|  | 					Name:  "skip-repo-update", | ||||||
|  | 					Usage: "skip running `helm repo update` on repositories declared in helmfile", | ||||||
| 				}, | 				}, | ||||||
| 				cli.BoolFlag{ | 				cli.BoolFlag{ | ||||||
| 					Name:  "detailed-exitcode", | 					Name:  "detailed-exitcode", | ||||||
|  | @ -188,7 +192,10 @@ func main() { | ||||||
| 			}, | 			}, | ||||||
| 			Action: func(c *cli.Context) error { | 			Action: func(c *cli.Context) error { | ||||||
| 				return findAndIterateOverDesiredStatesUsingFlags(c, func(state *state.HelmState, helm helmexec.Interface, ctx context) []error { | 				return findAndIterateOverDesiredStatesUsingFlags(c, func(state *state.HelmState, helm helmexec.Interface, ctx context) []error { | ||||||
|  | 					if !c.Bool("skip-repo-update") { | ||||||
| 						if c.Bool("sync-repos") { | 						if c.Bool("sync-repos") { | ||||||
|  | 							logger.Warnf("--sync-repos has been removed and `helmfile diff` updates repositories by default. Provide `--skip-repo-update` to opt-out.") | ||||||
|  | 						} | ||||||
| 						if errs := ctx.SyncReposOnce(state, helm); errs != nil && len(errs) > 0 { | 						if errs := ctx.SyncReposOnce(state, helm); errs != nil && len(errs) > 0 { | ||||||
| 							return errs | 							return errs | ||||||
| 						} | 						} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue