-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds checks for apiVersion for resources
- Loading branch information
Showing
19 changed files
with
106 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,33 @@ | ||
from typing import List, Type | ||
|
||
from icekube.models import ( | ||
clusterrole, | ||
clusterrolebinding, | ||
group, | ||
pod, | ||
role, | ||
rolebinding, | ||
secret, | ||
securitycontextconstraints, | ||
serviceaccount, | ||
user, | ||
) | ||
from icekube.models.api_resource import APIResource | ||
from icekube.models.base import Resource | ||
from icekube.models.cluster import Cluster | ||
from icekube.models.clusterrole import ClusterRole | ||
from icekube.models.clusterrolebinding import ClusterRoleBinding | ||
from icekube.models.group import Group | ||
from icekube.models.namespace import Namespace | ||
from icekube.models.pod import Pod | ||
from icekube.models.role import Role | ||
from icekube.models.rolebinding import RoleBinding | ||
from icekube.models.secret import Secret | ||
from icekube.models.securitycontextconstraints import ( | ||
SecurityContextConstraints, | ||
) | ||
from icekube.models.serviceaccount import ServiceAccount | ||
from icekube.models.signer import Signer | ||
from icekube.models.user import User | ||
|
||
enumerate_resource_kinds: List[Type[Resource]] = [ | ||
ClusterRole, | ||
ClusterRoleBinding, | ||
Namespace, | ||
Pod, | ||
Role, | ||
RoleBinding, | ||
Secret, | ||
SecurityContextConstraints, | ||
ServiceAccount, | ||
] | ||
|
||
|
||
# plurals: Dict[str, Type[Resource]] = {x.plural: x for x in enumerate_resource_kinds} | ||
|
||
|
||
__all__ = [ | ||
"APIResource", | ||
"Cluster", | ||
"ClusterRole", | ||
"ClusterRoleBinding", | ||
"Group", | ||
"Namespace", | ||
"Pod", | ||
"Role", | ||
"RoleBinding", | ||
"Secret", | ||
"SecurityContextConstraints", | ||
"ServiceAccount", | ||
"Signer", | ||
"User", | ||
"Resource", | ||
"clusterrole", | ||
"clusterrolebinding", | ||
"group", | ||
"pod", | ||
"role", | ||
"rolebinding", | ||
"secret", | ||
"securitycontextconstraints", | ||
"serviceaccount", | ||
"user", | ||
] |
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
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Dict | ||
from typing import List | ||
|
||
from icekube.models.base import Resource | ||
|
||
|
||
class Group(Resource): | ||
plural: str = "groups" | ||
|
||
@property | ||
def unique_identifiers(self) -> Dict[str, str]: | ||
return {**super().unique_identifiers, "plural": self.plural} | ||
supported_api_groups: List[str] = ["", "user.openshift.io"] |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from __future__ import annotations | ||
|
||
from typing import List | ||
|
||
from icekube.models.base import Resource | ||
|
||
|
||
class Node(Resource): | ||
... | ||
supported_api_groups: List[str] = [""] |
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
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.