Skip to content

Commit d7ce59a

Browse files
committed
support watching endpointslices for peers
1 parent c379903 commit d7ce59a

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

config/rbac/role.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ rules:
7474
- patch
7575
- update
7676
- watch
77+
- apiGroups:
78+
- discovery.k8s.io
79+
resources:
80+
- endpointslices
81+
verbs:
82+
- get
83+
- list
84+
- watch
7785
- apiGroups:
7886
- policy
7987
resources:

pkg/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,10 @@ func (c *Config) unpatchedRole() *applyrbacv1.RoleApplyConfiguration {
520520
WithAPIGroups("").
521521
WithResources("endpoints").
522522
WithVerbs("get", "list", "watch"),
523+
applyrbacv1.PolicyRule().
524+
WithAPIGroups("discovery.k8s.io").
525+
WithResources("endpointslices").
526+
WithVerbs("get", "list", "watch"),
523527
)
524528
}
525529

pkg/config/config_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,6 +2514,10 @@ metadata:
25142514
WithAPIGroups("").
25152515
WithResources("endpoints").
25162516
WithVerbs("get", "list", "watch"),
2517+
applyrbacv1.PolicyRule().
2518+
WithAPIGroups("discovery.k8s.io").
2519+
WithResources("endpointslices").
2520+
WithVerbs("get", "list", "watch"),
25172521
),
25182522
},
25192523
}

pkg/controller/controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import (
6767
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;create;update;patch;delete
6868
// +kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete
6969
// +kubebuilder:rbac:groups="",resources=endpoints,verbs=get;list;watch
70+
// +kubebuilder:rbac:groups=discovery.k8s.io,resources=endpointslices,verbs=get;list;watch
7071
// +kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=roles,verbs=get;list;watch;create;update;patch;delete
7172
// +kubebuilder:rbac:groups="rbac.authorization.k8s.io",resources=rolebindings,verbs=get;list;watch;create;update;patch;delete
7273

0 commit comments

Comments
 (0)