feat(apply): add ignore-release-not-found option
Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
		
							parent
							
								
									3d97ed0586
								
							
						
					
					
						commit
						d3f8ed7498
					
				|  | @ -72,6 +72,7 @@ func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command { | ||||||
| 	f.BoolVar(&applyOptions.SkipSchemaValidation, "skip-schema-validation", false, `pass --skip-schema-validation to "helm template" or "helm upgrade --install"`) | 	f.BoolVar(&applyOptions.SkipSchemaValidation, "skip-schema-validation", false, `pass --skip-schema-validation to "helm template" or "helm upgrade --install"`) | ||||||
| 	f.StringVar(&applyOptions.Cascade, "cascade", "", "pass cascade to helm exec, default: background") | 	f.StringVar(&applyOptions.Cascade, "cascade", "", "pass cascade to helm exec, default: background") | ||||||
| 	f.StringArrayVar(&applyOptions.SuppressOutputLineRegex, "suppress-output-line-regex", nil, "a list of regex patterns to suppress output lines from the diff output") | 	f.StringArrayVar(&applyOptions.SuppressOutputLineRegex, "suppress-output-line-regex", nil, "a list of regex patterns to suppress output lines from the diff output") | ||||||
|  | 	f.BoolVar(&applyOptions.IgnoreReleaseNotFound, "ignore-release-not-found", false, "Treat release not found as a successful uninstall") | ||||||
| 
 | 
 | ||||||
| 	return cmd | 	return cmd | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -70,6 +70,8 @@ type ApplyOptions struct { | ||||||
| 	SyncArgs string | 	SyncArgs string | ||||||
| 	// HideNotes is the hide notes flag
 | 	// HideNotes is the hide notes flag
 | ||||||
| 	HideNotes bool | 	HideNotes bool | ||||||
|  | 	// Ignore release not found
 | ||||||
|  | 	IgnoreReleaseNotFound bool | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // NewApply creates a new Apply
 | // NewApply creates a new Apply
 | ||||||
|  | @ -257,6 +259,12 @@ func (a *ApplyImpl) SyncArgs() string { | ||||||
| 	return a.ApplyOptions.SyncArgs | 	return a.ApplyOptions.SyncArgs | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // Hide Notes returns the HideNotes.
 | ||||||
| func (a *ApplyImpl) HideNotes() bool { | func (a *ApplyImpl) HideNotes() bool { | ||||||
| 	return a.ApplyOptions.HideNotes | 	return a.ApplyOptions.HideNotes | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | // IgnoreDeprecationWarnings returns the IgnoreDeprecationWarnings.
 | ||||||
|  | func (a *ApplyImpl) IgnoreReleaseNotFound() bool { | ||||||
|  | 	return a.ApplyOptions.IgnoreReleaseNotFound | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue