mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-21 08:21:35 +02:00
feat: update strategy for reinstall (#2019)
* feat: Add updateStrategy option in the state file with 'reinstall'/'reinstallIfForbidden' choices to uninstall and apply the specific release(s) (if forbidden to update) Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Fix unit tests related to the new updateStrategy feature Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Fix unit tests related to the new updateStrategy feature Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Resolve linter issue due to cognitive complexity Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Updated index.md to describe the possible values of updateStrategy Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Add validation of updateStrategy parameter and unit test Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Updated unit test Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Removed 'reinstall' update strategy option to only have reinstallIfForbidden, cleanup of pre-sync changes, adapted unit tests Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Display affected releases that were reinstalled Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Make sure to add --wait when deleting a release to be reinstalled due to reinstallIfForbidden Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> * Apply suggestions from Copilot code review Signed-off-by: Simon Bouchard <sbouchard@rbbn.com> --------- Signed-off-by: Simon Bouchard <sbouchard@rbbn.com>
This commit is contained in:
@@ -26,6 +26,8 @@ const (
|
||||
DefaultHCLFileExtension = ".hcl"
|
||||
)
|
||||
|
||||
var ValidUpdateStrategyValues = []string{UpdateStrategyReinstallIfForbidden}
|
||||
|
||||
type StateLoadError struct {
|
||||
Msg string
|
||||
Cause error
|
||||
@@ -43,6 +45,14 @@ func (e *UndefinedEnvError) Error() string {
|
||||
return fmt.Sprintf("environment \"%s\" is not defined", e.Env)
|
||||
}
|
||||
|
||||
type InvalidUpdateStrategyError struct {
|
||||
UpdateStrategy string
|
||||
}
|
||||
|
||||
func (e *InvalidUpdateStrategyError) Error() string {
|
||||
return fmt.Sprintf("updateStrategy %q is invalid, valid values are: %s or not set", e.UpdateStrategy, strings.Join(ValidUpdateStrategyValues, ", "))
|
||||
}
|
||||
|
||||
type StateCreator struct {
|
||||
logger *zap.SugaredLogger
|
||||
|
||||
|
||||
Reference in New Issue
Block a user