helm: fix upgrade command unintentionally skipping all service upgrades (#1992)

* Fix usage of errors.As in upgrade command implementation

* Use struct pointers when working with custom errors

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-06-30 16:46:05 +02:00 committed by GitHub
parent 5a9f9c0a52
commit d95ddd01d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 44 deletions

View file

@ -41,12 +41,12 @@ func NewInvalidUpgradeError(from string, to string, innerErr error) *InvalidUpgr
}
// Unwrap returns the inner error, which is nil in this case.
func (e InvalidUpgradeError) Unwrap() error {
func (e *InvalidUpgradeError) Unwrap() error {
return e.innerErr
}
// Error returns the String representation of this error.
func (e InvalidUpgradeError) Error() string {
func (e *InvalidUpgradeError) Error() string {
return fmt.Sprintf("upgrading from %s to %s is not a valid upgrade: %s", e.from, e.to, e.innerErr)
}