-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support additional expected instance roles. #25718
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4685,6 +4685,12 @@ func (process *TeleportProcess) waitForAppDepend() { | |
|
|
||
| // registerExpectedServices sets up the instance role -> identity event mapping. | ||
| func (process *TeleportProcess) registerExpectedServices(cfg *servicecfg.Config) { | ||
| // Register additional expected services for this Teleport instance. | ||
| // Meant for enterprise support. | ||
| for _, r := range cfg.AdditionalExpectedRoles { | ||
| process.SetExpectedInstanceRole(r.Role, r.IdentityEvent) | ||
| } | ||
|
Comment on lines
+4688
to
+4692
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Super dumb question but if these are "additional roles", then why is this block right at the front of the function rather than after all "regular expected roles" below? :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Truth be told I was taking a cue from AdditionalReadyEvents, but thinking on it it should probably be this way so that the OSS process can overwrite any conflicting instances with the ones it expects. Not that I expect that to be a frequent occurrence. |
||
|
|
||
| if cfg.Auth.Enabled { | ||
| process.SetExpectedInstanceRole(types.RoleAuth, AuthIdentityEvent) | ||
| } | ||
|
|
||
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.
Also, why do we need to pass this to OSS via AdditionalExpectedRoles, can't enterprise code just use
SetExpectedInstanceRole(...)on theprocesswhen initializing appropriate service?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.
It cannot, unfortunately. Basically the inventory status message is created at the very beginning of
NewTeleport, so the enterprise statuses never actually get the roles fromSetExpectedInstanceRole.