Skip to content

Commit

Permalink
Export ClusterFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbattirola committed Oct 31, 2024
1 parent 9fdd9b0 commit 72b7e75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ type Handler struct {
// userConns tracks amount of current active connections with user certificates.
userConns atomic.Int32

// clusterFeatures contain flags for supported and unsupported features.
clusterFeatures proto.Features
// ClusterFeatures contain flags for supported and unsupported features.
ClusterFeatures proto.Features

// nodeWatcher is a services.NodeWatcher used by Assist to lookup nodes from
// the proxy's cache and get nodes in real time.
Expand Down Expand Up @@ -405,7 +405,7 @@ func NewHandler(cfg Config, opts ...HandlerOption) (*APIHandler, error) {
log: newPackageLogger(),
logger: slog.Default().With(teleport.ComponentKey, teleport.ComponentWeb),
clock: clockwork.NewRealClock(),
clusterFeatures: cfg.ClusterFeatures,
ClusterFeatures: cfg.ClusterFeatures,
healthCheckAppServer: cfg.HealthCheckAppServer,
tracer: cfg.TracerProvider.Tracer(teleport.ComponentWeb),
wsIODeadline: wsIODeadline,
Expand Down
4 changes: 2 additions & 2 deletions lib/web/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ func (h *Handler) SetClusterFeatures(features proto.Features) {
h.Mutex.Lock()
defer h.Mutex.Unlock()

h.clusterFeatures = features
h.ClusterFeatures = features
}

// GetClusterFeatures returns flags for supported and unsupported features.
func (h *Handler) GetClusterFeatures() proto.Features {
h.Mutex.Lock()
defer h.Mutex.Unlock()

return h.clusterFeatures
return h.ClusterFeatures
}

// startFeatureWatcher periodically pings the auth server and updates `clusterFeatures`.
Expand Down
2 changes: 1 addition & 1 deletion lib/web/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestFeaturesWatcher(t *testing.T) {
Context: ctx,
},
clock: clock,
clusterFeatures: proto.Features{},
ClusterFeatures: proto.Features{},
log: newPackageLogger(),
logger: slog.Default().With(teleport.ComponentKey, teleport.ComponentWeb),
}
Expand Down

0 comments on commit 72b7e75

Please sign in to comment.