fix: Fix needs to work for upgrades and when selectors are provided (#922)

* fix: Fix `needs` to work for upgrades and when selectors are provided

Fixes #919

* Add test framework for `helmfile apply`

* Various enhancements and fixes to the DAG support

- Make the order of upgrades/deletes more deterministic for testability
- Fix the test framework so that we can validate log outputs and errors
- Add more test cases for `helmfile apply`, along with bug fixes.
- Make sure it fails with an intuitive error when you have non-existent releases referenced from witin "needs"
This commit is contained in:
KUOKA Yusuke
2019-11-02 14:04:16 +09:00
committed by GitHub
parent e258052933
commit 3f02b86640
15 changed files with 2278 additions and 618 deletions
+6 -6
View File
@@ -8,8 +8,8 @@ import (
func newExitError(helmCmdPath string, exitStatus int, errorMessage string) ExitError {
return ExitError{
msg: fmt.Sprintf("%s exited with status %d:\n%s", filepath.Base(helmCmdPath), exitStatus, indent(strings.TrimSpace(errorMessage))),
exitStatus: exitStatus,
Message: fmt.Sprintf("%s exited with status %d:\n%s", filepath.Base(helmCmdPath), exitStatus, indent(strings.TrimSpace(errorMessage))),
Code: exitStatus,
}
}
@@ -23,14 +23,14 @@ func indent(text string) string {
// ExitError is created whenever your shell command exits with a non-zero exit status
type ExitError struct {
msg string
exitStatus int
Message string
Code int
}
func (e ExitError) Error() string {
return e.msg
return e.Message
}
func (e ExitError) ExitStatus() int {
return e.exitStatus
return e.Code
}