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

Refactor tbot #12855

Merged
merged 8 commits into from
Jun 1, 2022
Merged

Refactor tbot #12855

merged 8 commits into from
Jun 1, 2022

Conversation

strideynet
Copy link
Contributor

@strideynet strideynet commented May 24, 2022

Refactors tbot to:

  • Introduce a struct to hang most of the renewal functionality off of. This allows a Bot instance to be programatically spawned.
  • Move the code related to renewals to lib/tbot, preserving purely CLI functionality within tool/tbot

This is part of work on #10891, as it's currently difficult for the CA rotation watcher to interact with the auth client used by the renewal mechanism.

@strideynet strideynet requested a review from timothyb89 May 24, 2022 09:49
@strideynet strideynet marked this pull request as ready for review May 24, 2022 09:49
@github-actions github-actions bot requested review from capnspacehook and r0mant May 24, 2022 09:49
@strideynet strideynet force-pushed the strideynet/refactor-tbot branch from e011bbf to 0556a5d Compare May 30, 2022 10:12
@strideynet
Copy link
Contributor Author

It would be nice to get this reviewed and merged some time this week, as work on tbot will easily conflict with this PR and I worry it will become an increasing amount of effort to keep this PR mergeable.

Copy link
Contributor

@timothyb89 timothyb89 left a comment

Choose a reason for hiding this comment

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

I think this is a big improvement! I don't see any issues but did manage to find my own bug while testing, go figure: #13034

Anyway, just a few nitpicks. Thanks for being flexible with this!

tool/tbot/main.go Outdated Show resolved Hide resolved
lib/tbot/tbot.go Outdated Show resolved Hide resolved
lib/tbot/tbot.go Outdated Show resolved Hide resolved
@strideynet strideynet force-pushed the strideynet/refactor-tbot branch 4 times, most recently from dc43938 to 7ececda Compare June 1, 2022 15:17
@strideynet strideynet force-pushed the strideynet/refactor-tbot branch from 7ececda to db428be Compare June 1, 2022 16:51
@strideynet strideynet enabled auto-merge (squash) June 1, 2022 16:51
@strideynet strideynet merged commit 8b346ef into master Jun 1, 2022
@github-actions
Copy link

github-actions bot commented Jun 1, 2022

@strideynet See the table below for backport results.

Branch Result
branch/v7 Failed
branch/v8 Failed
branch/v9 Failed

strideynet added a commit that referenced this pull request Jun 1, 2022
* start refactoring tbot to have a core struct

* refactor tbot into lib/

* move `tbot` subpackages to `lib/tbot`

* remove mutex pointer

* move `tshwrap` to `lib/` from `/tool/tbot/`

* move new template ssh client render test to lib/

* address pr feedback

* add request changed
strideynet added a commit that referenced this pull request Jun 1, 2022
* Demonstrate usage of `golden` for tbot template generation tests. (#12898)

* Refactor tbot (#12855)

* start refactoring tbot to have a core struct

* refactor tbot into lib/

* move `tbot` subpackages to `lib/tbot`

* remove mutex pointer

* move `tshwrap` to `lib/` from `/tool/tbot/`

* move new template ssh client render test to lib/

* address pr feedback

* add request changed
@webvictim webvictim mentioned this pull request Jun 8, 2022
@strideynet strideynet deleted the strideynet/refactor-tbot branch July 15, 2022 12:13
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