Skip to content

Commit

Permalink
Allow creating / syncing endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: David Festal <dfestal@redhat.com>
  • Loading branch information
davidfestal committed Mar 7, 2023
1 parent bded8df commit c747032
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rules:
verbs: ["*"]
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "list", "watch"]
verbs: ["*"]
- apiGroups: [""]
resources: ["services/status"]
verbs: ["get", "list", "watch"]
Expand Down
4 changes: 2 additions & 2 deletions pkg/syncer/status/status_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func NewStatusSyncer(syncerLogger logr.Logger, syncTargetClusterName logicalclus
informer, ok := informers[gvr]
if !ok {
if shared.ContainsGVR(notSynced, gvr) {
return nil, fmt.Errorf("informer for gvr %v not synced in the downstream informer factory - should retry", gvr)
return nil, fmt.Errorf("informer for gvr %v not synced in the upstream syncer informer factory - should retry", gvr)
}
return nil, fmt.Errorf("gvr %v should be known in the downstream informer factory", gvr)
return nil, fmt.Errorf("gvr %v should be known in the upstream syncer informer factory", gvr)
}
return informer.Lister(), nil
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func StartSyncer(ctx context.Context, cfg *SyncerConfig, numSyncerThreads int, i
&filteredGVRSource{
GVRSource: syncTargetGVRSource,
keepGVR: func(gvr schema.GroupVersionResource) bool {
// Don't expose pods or endpoints via the syncer vw
if gvr.Group == corev1.GroupName && (gvr.Resource == "pods" || gvr.Resource == "endpoints") {
// Don't expose pods via the syncer vw
if gvr.Group == corev1.GroupName && (gvr.Resource == "pods") {
return false
}
return true
Expand Down
5 changes: 2 additions & 3 deletions pkg/virtual/syncer/builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ func BuildVirtualWorkspace(
filteredResourceState: workloadv1alpha1.ResourceStateSync,
restProviderBuilder: NewSyncerRestProvider,
allowedAPIFilter: func(apiGroupResource schema.GroupResource) bool {
// Don't expose Endpoints or Pods via the Syncer VirtualWorkspace.
// Don't expose Pods via the Syncer VirtualWorkspace.
if apiGroupResource.Group == "" &&
(apiGroupResource.Resource == "pods" ||
apiGroupResource.Resource == "endpoints") {
(apiGroupResource.Resource == "pods") {
return false
}
return true
Expand Down

0 comments on commit c747032

Please sign in to comment.