generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support typeless kubernetes resources when generating manifests (…
…#931) * Support typeless kubernetes resources when generating manifests Typeless kubernetes resource has no Group and Plural value, so generating wrong policy rule. Commit summary: 1) Use ApiGroup value from GVK and '*' for Plural value if dependent resource is assignable from GenericKubernetesDependentResource 2) Merge verbs in rule for optimization if with same ApiGroups and Resources * cleanup code-checking problems * fix missing assertion * Refactor AddClusterRolesDecorator for more understandable --------- Co-authored-by: cc <cc@xpie.cn>
- Loading branch information
1 parent
cc34493
commit 3ad74ac
Showing
5 changed files
with
162 additions
and
40 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
...nt/src/test/java/io/quarkiverse/operatorsdk/test/sources/TypelessAnotherKubeResource.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,18 @@ | ||
package io.quarkiverse.operatorsdk.test.sources; | ||
|
||
import io.javaoperatorsdk.operator.api.reconciler.dependent.Deleter; | ||
import io.javaoperatorsdk.operator.processing.GroupVersionKind; | ||
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.GenericKubernetesDependentResource; | ||
|
||
public class TypelessAnotherKubeResource extends GenericKubernetesDependentResource<TestCR> implements Deleter<TestCR> { | ||
|
||
public static final String GROUP = "crd.josdk.quarkiverse.io"; | ||
public static final String KIND = "typelessAnother"; | ||
public static final String VERSION = "v1"; | ||
private static final GroupVersionKind GVK = new GroupVersionKind(GROUP, VERSION, KIND); | ||
|
||
public TypelessAnotherKubeResource() { | ||
super(GVK); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...eployment/src/test/java/io/quarkiverse/operatorsdk/test/sources/TypelessKubeResource.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,17 @@ | ||
package io.quarkiverse.operatorsdk.test.sources; | ||
|
||
import io.javaoperatorsdk.operator.processing.GroupVersionKind; | ||
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.GenericKubernetesDependentResource; | ||
|
||
public class TypelessKubeResource extends GenericKubernetesDependentResource<TestCR> { | ||
|
||
public static final String GROUP = "crd.josdk.quarkiverse.io"; | ||
public static final String KIND = "typeless"; | ||
public static final String VERSION = "v1"; | ||
private static final GroupVersionKind GVK = new GroupVersionKind(GROUP, VERSION, KIND); | ||
|
||
public TypelessKubeResource() { | ||
super(GVK); | ||
} | ||
|
||
} |