Skip to content

Export auth server version for upgrader#34917

Closed
bernardjkim wants to merge 6 commits intomasterfrom
bernard/auth-version-check
Closed

Export auth server version for upgrader#34917
bernardjkim wants to merge 6 commits intomasterfrom
bernard/auth-version-check

Conversation

@bernardjkim
Copy link
Copy Markdown
Contributor

Paired with https://github.com/gravitational/teleport.e/pull/2722
Supports https://github.com/gravitational/cloud/issues/6773

Teleport will now export the auth server version:

  • On kube agents, the auth server version will be exported to the backend with key agent-auth-version.
  • On systemd agents, the auth server version will be exported to the /etc/teleport-upgrade.d/version unit file.

This is necessary for the teleport-upgrade script to be able to identify the auth server version, and prevent an upgrade if the target upgrade version is a newer major version than the auth server.

@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Copy link
Copy Markdown
Contributor

@espadolini espadolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The auth version is never going to change while we are holding a connection to the auth server, and we're holding a connection to the auth server as part of the standard behavior of the inventory control stream; could we just update the auth version whenever that connects, instead of piggybacking onto the upgrade window synchronizer? DownstreamInventoryHello already has the version of the auth server in it.

Comment thread lib/versioncontrol/upgradewindow/upgradewindow.go Outdated
return trace.Wrap(err)
}

if err := os.WriteFile(e.versionFile(), []byte(version), defaults.FilePermissions); err != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fspmarshall shouldn't this (and the schedule one) be atomic writes? What happens if the upgrader runs right as we're writing the file?

@bernardjkim
Copy link
Copy Markdown
Contributor Author

Closing in favor of #35150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants