-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[v15] Update Proxy Features #48224
[v15] Update Proxy Features #48224
Conversation
* Add feature watcher * Add test * Update godocs, fix typos, rename SupportEntitlementsCompatibility to BackfillFeatures * Godocs; rename start and stop functions * Use `Feature` prefix in var names instead of `License` * Fix lint * Fix TestGetWebConfig_LegacyFeatureLimits * Fix TestGetWebConfig_WithEntitlements * Fix tests and lint * Remove sync.Once * Add jitter * Remove Ping call from getUserContext * Move entitlements test to entitlements package * Apply suggestions from code review: godoc and tests improvement. Co-authored-by: Zac Bergquist <[email protected]> * Improve tests * Shadow `t` in EventuallyWithT closure to avoid mistakes * Improve startFeatureWatcher godoc * Log features on update * Log features on update * Avoid race condition on test * Improve TODO comment Co-authored-by: rosstimothy <[email protected]> * Use handler config context * Start feature watcher in NewHandler * Improve startFeatureWatcher godocs * Add TODO to unexport SetClusterFeatures * Remove featureWatcherReady * Use require in require.EventuallyWithT in cases where an error is not expected * Use return of assert.NoError` to return early on require.EventuallyWithT --------- Co-authored-by: Zac Bergquist <[email protected]> Co-authored-by: rosstimothy <[email protected]>
This pull request is automatically being deployed by Amplify Hosting (learn more). |
40a2506
to
2cad841
Compare
2cad841
to
cf91623
Compare
Required for https://github.com/gravitational/cloud/issues/9458 |
@@ -339,6 +343,8 @@ func (c *Config) SetDefaults() { | |||
if c.PresenceChecker == nil { | |||
c.PresenceChecker = client.RunPresenceTask | |||
} | |||
|
|||
c.FeatureWatchInterval = cmp.Or(c.FeatureWatchInterval, DefaultFeatureWatchInterval) |
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.
FYI, cmp.Or
requires Go 1.22 or later.
We build with Go 1.22, so that's why the build hasn't failed.
We do however set the language level to Go 1.21 in branch/v15, which generates a warning.
module github.com/gravitational/teleport
go 1.21
toolchain go1.22.10
At this point, we might as well just update the go directive to 1.22 here.
Backport #45979 to branch/v15
This was manually backported and required some changes:
entitlements
package on v15, so all calls to its methods and types were removed.getUserContext
to useh.GetFeatures()
. This is because in v15 this method has some additional logic for compatibility that it uses thePing
call to determine. In the original PR, thePing
was only for fetching features, so it was replaced, but in this PR I didn't touch that code to preserve the current behavior.h.ClusterFeatures
, that the original PR made private. This is to prevent the build from breaking when we merge this PR, since Teleport Enterprise uses this method.Teleport.E backport: https://github.com/gravitational/teleport.e/pull/5295
Note that
Entitlements
is a new version ofFeatures
. They currently coexist in master for compatibility, so even though a package used in the original PR doesn't exist, it is fine to backport this because the original PR also updated theFeatures
.