@@ -105,7 +105,6 @@ type legacyCollections struct {
105
105
userTasks collectionReader [userTasksGetter ]
106
106
kubeWaitingContainers collectionReader [kubernetesWaitingContainerGetter ]
107
107
staticHostUsers collectionReader [staticHostUserGetter ]
108
- networkRestrictions collectionReader [networkRestrictionGetter ]
109
108
remoteClusters collectionReader [remoteClusterGetter ]
110
109
userLoginStates collectionReader [services.UserLoginStatesGetter ]
111
110
dynamicWindowsDesktops collectionReader [dynamicWindowsDesktopsGetter ]
@@ -154,15 +153,6 @@ func setupLegacyCollections(c *Cache, watches []types.WatchKind) (*legacyCollect
154
153
watch : watch ,
155
154
}
156
155
collections .byKind [resourceKind ] = collections .databaseObjects
157
- case types .KindNetworkRestrictions :
158
- if c .Restrictions == nil {
159
- return nil , trace .BadParameter ("missing parameter Restrictions" )
160
- }
161
- collections .networkRestrictions = & genericCollection [types.NetworkRestrictions , networkRestrictionGetter , networkRestrictionsExecutor ]{
162
- cache : c ,
163
- watch : watch ,
164
- }
165
- collections .byKind [resourceKind ] = collections .networkRestrictions
166
156
case types .KindDynamicWindowsDesktop :
167
157
if c .WindowsDesktops == nil {
168
158
return nil , trace .BadParameter ("missing parameter DynamicWindowsDesktops" )
@@ -502,43 +492,6 @@ func (databaseObjectExecutor) getReader(cache *Cache, cacheOK bool) services.Dat
502
492
503
493
var _ executor [* dbobjectv1.DatabaseObject , services.DatabaseObjectsGetter ] = databaseObjectExecutor {}
504
494
505
- type networkRestrictionsExecutor struct {}
506
-
507
- func (networkRestrictionsExecutor ) getAll (ctx context.Context , cache * Cache , loadSecrets bool ) ([]types.NetworkRestrictions , error ) {
508
- restrictions , err := cache .Restrictions .GetNetworkRestrictions (ctx )
509
- if err != nil {
510
- return nil , trace .Wrap (err )
511
- }
512
- return []types.NetworkRestrictions {restrictions }, nil
513
- }
514
-
515
- func (networkRestrictionsExecutor ) upsert (ctx context.Context , cache * Cache , resource types.NetworkRestrictions ) error {
516
- return cache .restrictionsCache .SetNetworkRestrictions (ctx , resource )
517
- }
518
-
519
- func (networkRestrictionsExecutor ) deleteAll (ctx context.Context , cache * Cache ) error {
520
- return cache .restrictionsCache .DeleteNetworkRestrictions (ctx )
521
- }
522
-
523
- func (networkRestrictionsExecutor ) delete (ctx context.Context , cache * Cache , resource types.Resource ) error {
524
- return cache .restrictionsCache .DeleteNetworkRestrictions (ctx )
525
- }
526
-
527
- func (networkRestrictionsExecutor ) isSingleton () bool { return true }
528
-
529
- func (networkRestrictionsExecutor ) getReader (cache * Cache , cacheOK bool ) networkRestrictionGetter {
530
- if cacheOK {
531
- return cache .restrictionsCache
532
- }
533
- return cache .Config .Restrictions
534
- }
535
-
536
- type networkRestrictionGetter interface {
537
- GetNetworkRestrictions (context.Context ) (types.NetworkRestrictions , error )
538
- }
539
-
540
- var _ executor [types.NetworkRestrictions , networkRestrictionGetter ] = networkRestrictionsExecutor {}
541
-
542
495
type dynamicWindowsDesktopsExecutor struct {}
543
496
544
497
func (dynamicWindowsDesktopsExecutor ) getAll (ctx context.Context , cache * Cache , loadSecrets bool ) ([]types.DynamicWindowsDesktop , error ) {
0 commit comments