File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public static V1ClusterRole GenerateManagerRbac()
38
38
new V1ObjectMeta { Name = "operator-role" } ,
39
39
new List < V1PolicyRule > (
40
40
GetAttributes < EntityRbacAttribute > ( assembly )
41
+ . Concat ( GetAttributes < EntityRbacAttribute > ( Assembly . GetExecutingAssembly ( ) ) )
41
42
. SelectMany ( a => a . CreateRbacPolicies ( ) )
42
43
. Concat ( GetAttributes < GenericRbacAttribute > ( assembly ) . Select ( a => a . CreateRbacPolicy ( ) ) ) ) ) ;
43
44
}
Original file line number Diff line number Diff line change 5
5
using System . Threading . Tasks ;
6
6
using k8s . Models ;
7
7
using KubeOps . Operator . Client ;
8
+ using KubeOps . Operator . Rbac ;
8
9
using Microsoft . Extensions . Hosting ;
9
10
using Microsoft . Extensions . Logging ;
10
11
using Microsoft . Rest ;
11
12
using Timer = System . Timers . Timer ;
12
13
13
14
namespace KubeOps . Operator . Leadership
14
15
{
16
+ [ EntityRbac ( typeof ( V1Lease ) , Verbs = RbacVerb . All ) ]
15
17
internal class LeaderElector : IHostedService
16
18
{
17
19
private readonly ILogger < LeaderElector > _logger ;
Original file line number Diff line number Diff line change 19
19
<ProjectReference Include =" ..\..\src\KubeOps\KubeOps.csproj" />
20
20
</ItemGroup >
21
21
22
+ <ItemGroup >
23
+ <Folder Include =" Operator\Leadership" />
24
+ <Folder Include =" Operator\Queue" />
25
+ <Folder Include =" Operator\Watcher" />
26
+ </ItemGroup >
27
+
22
28
</Project >
You can’t perform that action at this time.
0 commit comments