-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
os.Exit(1) | ||
} | ||
setupLog.Info("Connected to teleport cluster", "proxyAddr", tele.SecretConfig.ProxyAddr) | ||
|
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
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