generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: @RBACRoleRef to assign existing cluster roles (#865)
Added new annotation @RBACRoleRef to assign an existing cluster role to the controllers --------- Signed-off-by: Chris Laprun <[email protected]> Co-authored-by: domenico.loiaconoa <[email protected]> Co-authored-by: Chris Laprun <[email protected]> Co-authored-by: Chris Laprun <[email protected]>
- Loading branch information
1 parent
40fd75c
commit cae40e9
Showing
18 changed files
with
351 additions
and
76 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
annotations/src/main/java/io/quarkiverse/operatorsdk/annotations/AdditionalRBACRoleRefs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.quarkiverse.operatorsdk.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
@SuppressWarnings("unused") | ||
public @interface AdditionalRBACRoleRefs { | ||
RBACCRoleRef[] value(); | ||
} |
25 changes: 25 additions & 0 deletions
25
annotations/src/main/java/io/quarkiverse/operatorsdk/annotations/RBACCRoleRef.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.quarkiverse.operatorsdk.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Repeatable; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
@Repeatable(AdditionalRBACRoleRefs.class) | ||
public @interface RBACCRoleRef { | ||
String RBAC_API_GROUP = "rbac.authorization.k8s.io"; | ||
|
||
RoleKind kind() default RoleKind.Role; | ||
|
||
String name() default ""; | ||
|
||
enum RoleKind { | ||
|
||
ClusterRole, | ||
Role; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.