mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-30 04:29:57 +00:00
fix(service): populate Cluster.Private in GetClusters response
The Cluster struct carried a Private *bool field and the proxy-manager forwarder ClusterSupportsPrivate already existed, but the service manager's CapabilityProvider interface didn't declare it and GetClusters never called it. Result: clusters[i].Private stayed nil and the openapi omitempty stripped the field from the JSON response, hiding the private-cluster signal from the dashboard. - CapabilityProvider gains ClusterSupportsPrivate. - GetClusters populates clusters[i].Private alongside the other capability flags so the dashboard's clusters page can render the private indicator. The concrete CapabilityProvider impl (proxy.Manager) already provides the forwarder, and proxy.MockManager (used by existing tests) is regenerated with the new method already present.
This commit is contained in:
@@ -82,6 +82,7 @@ type CapabilityProvider interface {
|
||||
ClusterSupportsCustomPorts(ctx context.Context, clusterAddr string) *bool
|
||||
ClusterRequireSubdomain(ctx context.Context, clusterAddr string) *bool
|
||||
ClusterSupportsCrowdSec(ctx context.Context, clusterAddr string) *bool
|
||||
ClusterSupportsPrivate(ctx context.Context, clusterAddr string) *bool
|
||||
}
|
||||
|
||||
type Manager struct {
|
||||
@@ -136,6 +137,7 @@ func (m *Manager) GetClusters(ctx context.Context, accountID, userID string) ([]
|
||||
clusters[i].SupportsCustomPorts = m.capabilities.ClusterSupportsCustomPorts(ctx, clusters[i].Address)
|
||||
clusters[i].RequireSubdomain = m.capabilities.ClusterRequireSubdomain(ctx, clusters[i].Address)
|
||||
clusters[i].SupportsCrowdSec = m.capabilities.ClusterSupportsCrowdSec(ctx, clusters[i].Address)
|
||||
clusters[i].Private = m.capabilities.ClusterSupportsPrivate(ctx, clusters[i].Address)
|
||||
}
|
||||
|
||||
return clusters, nil
|
||||
|
||||
Reference in New Issue
Block a user