Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
fallback installed etcd version on corrupt metadata (#2344)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Nisbet authored Nov 23, 2020
1 parent b58d6c3 commit c4c8690
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/update/cluster/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"sort"
"strconv"
"strings"

libapp "github.com/gravitational/gravity/lib/app"
"github.com/gravitational/gravity/lib/constants"
Expand Down Expand Up @@ -76,7 +77,12 @@ func (r *phaseBuilder) initSteps(ctx context.Context) (err error) {
if installedOrUpgradedEtcdVersion == nil {
installedOrUpgradedEtcdVersion, err = getEtcdVersionFromManifest(r.installedApp.Manifest, r.packages)
if err != nil && !trace.IsNotFound(err) {
return trace.Wrap(err)
// Several versions of gravity 6.1 have corrupted planet metadata for the etcd version.
// If we fail to parse the etcd version, fallback to the currentEtcdVersion included below.
// https://github.com/gravitational/gravity/issues/2031
if !strings.Contains(err.Error(), "REPLACE_ETCD_LATEST_VERSION") {
return trace.Wrap(err)
}
}
}
if installedOrUpgradedEtcdVersion == nil {
Expand Down

0 comments on commit c4c8690

Please sign in to comment.