From a548104e0624a8687d1aca9e2e51af0660fa64ce Mon Sep 17 00:00:00 2001 From: yaroslavborbat Date: Wed, 11 Dec 2024 18:02:13 +0300 Subject: [PATCH] fix Signed-off-by: yaroslavborbat --- hooks/mc_webhook.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hooks/mc_webhook.py b/hooks/mc_webhook.py index 250fa65fa..0b8979f77 100755 --- a/hooks/mc_webhook.py +++ b/hooks/mc_webhook.py @@ -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 @@ -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", } @@ -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