Add --skip-diff-on-install to helmfile diff (#1841)
* Add --skip-diff-on-install to helmfile diff
This commit is contained in:
		
							parent
							
								
									f502a0a779
								
							
						
					
					
						commit
						92ba347d6f
					
				
							
								
								
									
										4
									
								
								main.go
								
								
								
								
							
							
						
						
									
										4
									
								
								main.go
								
								
								
								
							|  | @ -207,6 +207,10 @@ func main() { | ||||||
| 					Name:  "include-needs", | 					Name:  "include-needs", | ||||||
| 					Usage: `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`, | 					Usage: `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`, | ||||||
| 				}, | 				}, | ||||||
|  | 				cli.BoolFlag{ | ||||||
|  | 					Name:  "skip-diff-on-install", | ||||||
|  | 					Usage: "Skips running helm-diff on releases being newly installed on this apply. Useful when the release manifests are too huge to be reviewed, or it's too time-consuming to diff at all", | ||||||
|  | 				}, | ||||||
| 				cli.BoolFlag{ | 				cli.BoolFlag{ | ||||||
| 					Name:  "suppress-secrets", | 					Name:  "suppress-secrets", | ||||||
| 					Usage: "suppress secrets in the output. highly recommended to specify on CI/CD use-cases", | 					Usage: "suppress secrets in the output. highly recommended to specify on CI/CD use-cases", | ||||||
|  |  | ||||||
|  | @ -1440,6 +1440,7 @@ func (a *App) diff(r *Run, c DiffConfigProvider) (*string, bool, bool, []error) | ||||||
| 		Output:            c.DiffOutput(), | 		Output:            c.DiffOutput(), | ||||||
| 		NoColor:           c.NoColor(), | 		NoColor:           c.NoColor(), | ||||||
| 		Set:               c.Set(), | 		Set:               c.Set(), | ||||||
|  | 		SkipDiffOnInstall: c.SkipDiffOnInstall(), | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	st.Releases = selectedAndNeededReleases | 	st.Releases = selectedAndNeededReleases | ||||||
|  |  | ||||||
|  | @ -98,6 +98,7 @@ type DiffConfigProvider interface { | ||||||
| 	SuppressSecrets() bool | 	SuppressSecrets() bool | ||||||
| 	ShowSecrets() bool | 	ShowSecrets() bool | ||||||
| 	SuppressDiff() bool | 	SuppressDiff() bool | ||||||
|  | 	SkipDiffOnInstall() bool | ||||||
| 
 | 
 | ||||||
| 	SkipNeeds() bool | 	SkipNeeds() bool | ||||||
| 	IncludeNeeds() bool | 	IncludeNeeds() bool | ||||||
|  |  | ||||||
|  | @ -36,6 +36,7 @@ type diffConfig struct { | ||||||
| 	concurrency       int | 	concurrency       int | ||||||
| 	detailedExitcode  bool | 	detailedExitcode  bool | ||||||
| 	interactive       bool | 	interactive       bool | ||||||
|  | 	skipDiffOnInstall bool | ||||||
| 	logger            *zap.SugaredLogger | 	logger            *zap.SugaredLogger | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -111,6 +112,10 @@ func (a diffConfig) Interactive() bool { | ||||||
| 	return a.interactive | 	return a.interactive | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | func (a diffConfig) SkipDiffOnInstall() bool { | ||||||
|  | 	return a.skipDiffOnInstall | ||||||
|  | } | ||||||
|  | 
 | ||||||
| func (a diffConfig) Logger() *zap.SugaredLogger { | func (a diffConfig) Logger() *zap.SugaredLogger { | ||||||
| 	return a.logger | 	return a.logger | ||||||
| } | } | ||||||
|  | @ -129,6 +134,7 @@ func TestDiff(t *testing.T) { | ||||||
| 		loc               string | 		loc               string | ||||||
| 		ns                string | 		ns                string | ||||||
| 		concurrency       int | 		concurrency       int | ||||||
|  | 		skipDiffOnInstall bool | ||||||
| 		detailedExitcode  bool | 		detailedExitcode  bool | ||||||
| 		error             string | 		error             string | ||||||
| 		flags             flags | 		flags             flags | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue