Fix for panic during upgrade of edge version dapr (#983)

* Fix for panic during upgrade of edge version dapr

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* change console log message

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
This commit is contained in:
Pravin Pushkar 2022-06-01 22:17:32 +05:30 committed by GitHub
parent 3d01ffd8d3
commit 8e9c675bf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -169,7 +169,12 @@ func upgradeChartValues(ca, issuerCert, issuerKey string, haMode, mtls bool, arg
func isDowngrade(targetVersion, existingVersion string) bool {
target, _ := version.NewVersion(targetVersion)
existing, _ := version.NewVersion(existingVersion)
existing, err := version.NewVersion(existingVersion)
if err != nil {
print.FailureStatusEvent(
os.Stderr,
fmt.Sprintf("Upgrade failed, %s. The current installed version does not have sematic versioning", err.Error()))
os.Exit(1)
}
return target.LessThan(existing)
}