Skip to content

Add teleport status --is-up-to-date#55646

Merged
hugoShaka merged 3 commits intomasterfrom
hugo/teleport-update-is-up-to-date
Jun 20, 2025
Merged

Add teleport status --is-up-to-date#55646
hugoShaka merged 3 commits intomasterfrom
hugo/teleport-update-is-up-to-date

Conversation

@hugoShaka
Copy link
Copy Markdown
Contributor

This PR adds a flag --is-up-to-date to the teleport-update status command. In some specific setups, users don't have systemd but still want to write their own logic to update and restart Teleport. See this Slack thread for more context.

While we cannot cover every use-case, we can make it easy for users to detect if an update is required. They will then be responsible for triggering the update and reloading/restarting the teleport processes.

Changelog: Adds the the teleport-update status --is-up-to-date flag to change the return code based on the update status.

Copy link
Copy Markdown
Contributor

@vapopov vapopov left a comment

Choose a reason for hiding this comment

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

I would add a test for this command func Run(args []string) int

@hugoShaka
Copy link
Copy Markdown
Contributor Author

I would add a test for this command func Run(args []string) int

I'm not a huge fan of testing the whole status thing as it's going to require a full blown mock environment, with a fake config, proxy mock, ... This is basically an integration test and should be in integration/

One quick way to add coverage would be to extract a small function:

func statusExitCode(ccfg cliConfig, status agent.Status) int {
    // ...
}

Would this work for you?

@hugoShaka hugoShaka force-pushed the hugo/teleport-update-is-up-to-date branch from 856e39f to 84b2389 Compare June 20, 2025 14:23
@hugoShaka hugoShaka enabled auto-merge June 20, 2025 14:24
@hugoShaka hugoShaka added this pull request to the merge queue Jun 20, 2025
Merged via the queue into master with commit d66a0f8 Jun 20, 2025
40 checks passed
@hugoShaka hugoShaka deleted the hugo/teleport-update-is-up-to-date branch June 20, 2025 15:06
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@hugoShaka See the table below for backport results.

Branch Result
branch/v15 Create PR
branch/v16 Create PR
branch/v17 Create PR
branch/v18 Create PR

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants