Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: yaroslavborbat <[email protected]>
  • Loading branch information
yaroslavborbat committed Dec 11, 2024
1 parent e88635e commit a548104
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hooks/mc_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def parse_ip_address(ip_string):
class ModuleConfigValidateHook(Hook):
SNAPSHOT_NAME = "virtualmachineipaddresslease"
VALIDATOR_NAME = "moduleconfig-virtualization"
MODULE_CONFIG_KIND = "ModuleConfig"

def __init__(self, module_name: str):
self.module_name = module_name
Expand All @@ -52,9 +51,9 @@ def generate_config(self) -> dict:
"group": "main",
"rules": [
{
"apiVersions": "v1alpha1",
"apiGroups": "deckhouse.io",
"resources": [self.MODULE_CONFIG_KIND],
"apiVersions": ["v1alpha1"],
"apiGroups": ["deckhouse.io"],
"resources": ["moduleconfigs"],
"operations": ["UPDATE"],
"scope": "Cluster",
}
Expand Down Expand Up @@ -83,7 +82,7 @@ def r(ctx: hook.Context):

kind = request.get("kind", {}).get("kind", "")
name = request.get("name", "")
if kind != self.MODULE_CONFIG_KIND or name != self.module_name:
if kind != "ModuleConfig" or name != self.module_name:
self.__allow(ctx, "")
return

Expand Down

0 comments on commit a548104

Please sign in to comment.