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 Matchine ID & Tests #37

Merged
merged 17 commits into from
Nov 16, 2023
Merged

Teleport Matchine ID & Tests #37

merged 17 commits into from
Nov 16, 2023

Conversation

vvondruska
Copy link
Contributor

@vvondruska vvondruska commented Nov 15, 2023

What this PR does / why we need it

Made some adjustments in the code to add support for additional tests
Migrated main operator configuration from secret to config map
Added tests of Teleport machine ID renewal

Checklist

  • Update changelog in CHANGELOG.md.

os.Exit(1)
}
setupLog.Info("Connected to teleport cluster", "proxyAddr", tele.SecretConfig.ProxyAddr)

Copy link
Contributor Author

@vvondruska vvondruska Nov 16, 2023

Choose a reason for hiding this comment

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

Teleport client requires an identity file. However, when the operator starts, the identity may not be available yet, because it's provided by an external resource (tbot).
So, it is not safe to instantiate the client when the operator starts, because it would cause a crash in case the identity is not available.
Therefore, the creation of Teleport client was moved to reconciliation..

@@ -19,7 +19,7 @@ type Client interface {
DeleteToken(ctx context.Context, name string) error
}

func NewClient(ctx context.Context, proxyAddr, identityFile string) (Client, error) {
var NewClient = func(ctx context.Context, proxyAddr, identityFile string) (Client, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this to a variable, so that it can be replaced with a mock in tests.

@vvondruska vvondruska marked this pull request as ready for review November 16, 2023 13:21
@vvondruska vvondruska requested a review from a team as a code owner November 16, 2023 13:21
@vvondruska vvondruska merged commit 7a5f735 into tbot Nov 16, 2023
6 checks passed
@vvondruska vvondruska deleted the tbot-ext branch November 16, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant