Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teleport-update] status subcommand #49308

Merged
merged 5 commits into from
Nov 21, 2024
Merged

Conversation

sclevine
Copy link
Member

@sclevine sclevine commented Nov 21, 2024

This PR implements the teleport-update status subcommand. Running this command outputs a combination of local and remote status fields that describe the state of agent auto-updates from this agent's perspective.

Additionally, this PR moves all config management logic into config.go. The previous contents of config.go are now in setup.go.

Depends on: #49307


The teleport-update binary will be used to enable, disable, and trigger automatic Teleport agent updates. The new auto-updates system manages a local installation of the cluster-specified version of Teleport stored in /var/lib/teleport/versions.

RFD: #47126
Goal (internal): https://github.com/gravitational/cloud/issues/10289

Example:

ubuntu@legendary-mite:~$ ./teleport-update status
proxy: teleport.example.com
enabled: true
pinned: true
active_version: 16.4.3
backup_version: 16.4.1
target_version: 17.0.1
flags:
    - Enterprise
in_window: true
jitter: 1m0s

@sclevine sclevine added the no-changelog Indicates that a PR does not require a changelog entry label Nov 21, 2024
@sclevine sclevine changed the base branch from master to sclevine/teleport-update-pin November 21, 2024 04:06
if err != nil {
return trace.Errorf("failed to write teleport-update systemd config files: %w", err)
return nil, trace.Errorf("failed to open: %w", err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider trace.ConvertSystemErr for filesystem operations.

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like that would convert the os/fs errors to trace-specific types that this package isn't looking for? Or is the primary intent to avoid stack traces for these errors?

I haven't found any guidelines on when trace should be used or avoided. I try to avoid everything besides trace.Errorf and trace.Wrap (unless I'm writing code that is called by something that expects a specific trace error). That said, happy to follow repo conventions.

@sclevine sclevine force-pushed the sclevine/teleport-update-status branch from ef4c39c to 79609c4 Compare November 21, 2024 18:47
Base automatically changed from sclevine/teleport-update-pin to master November 21, 2024 21:40
@sclevine sclevine force-pushed the sclevine/teleport-update-status branch from 79609c4 to 214f13e Compare November 21, 2024 22:02
@sclevine sclevine enabled auto-merge November 21, 2024 22:03
@sclevine sclevine added this pull request to the merge queue Nov 21, 2024
Merged via the queue into master with commit e6fb164 Nov 21, 2024
42 checks passed
@sclevine sclevine deleted the sclevine/teleport-update-status branch November 21, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants