Skip to content

Commit

Permalink
Temporary fix major version check for v18
Browse files Browse the repository at this point in the history
  • Loading branch information
vapopov committed Dec 5, 2024
1 parent f7bf7eb commit 31b7aab
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion lib/auth/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func initCluster(ctx context.Context, cfg InitConfig, asrv *Server) error {
if err != nil {
return trace.Wrap(err)
}
if err := validateAndUpdateTeleportVersion(ctx, cfg.VersionStorage, teleport.SemVersion, firstStart); err != nil {
if err := validateAndUpdateTeleportVersion(ctx, cfg.VersionStorage, teleport.SemVersion); err != nil {
return trace.Wrap(err)
}

Expand Down
12 changes: 0 additions & 12 deletions lib/auth/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,13 @@ func validateAndUpdateTeleportVersion(
ctx context.Context,
storage VersionStorage,
currentVersion *semver.Version,
firstTimeStart bool,
) error {
if skip := os.Getenv(skipVersionUpgradeCheckEnv); skip != "" {
return nil
}

lastKnownVersion, err := storage.GetTeleportVersion(ctx)
if trace.IsNotFound(err) {
// When this is not the first start, we have to ensure that previous versions,
// introduced before this check, were also verified. Therefore, not having a version
// in the database means the last known version is <v17.
if !firstTimeStart {
return trace.BadParameter("Unsupported upgrade path detected: to %v. "+
"Teleport supports direct upgrades to the next major version only.\n "+
"For instance, if you have version 15.x.x, you must upgrade to version 16.x.x first. "+
"See compatibility guarantees for details: "+
"https://goteleport.com/docs/upgrading/overview/#component-compatibility.",
currentVersion.String())
}
if err := storage.WriteTeleportVersion(ctx, currentVersion); err != nil {
return trace.Wrap(err)
}
Expand Down

0 comments on commit 31b7aab

Please sign in to comment.