Skip to content

Commit f2c86f0

Browse files
committed
use new error code for resource permission
1 parent 5c28656 commit f2c86f0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

playbooks/robusta_playbooks/k8s_resource_enrichments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def get_resource_yaml(event: KubernetesResourceEvent):
303303
name: str = resource.metadata.name
304304

305305
if resource_kind.lower() in RESOURCE_YAML_BLOCK_LIST:
306-
raise ActionException(ErrorCodes.RESOURCE_NOT_FOUND, f"{resource_kind.lower()} type is blocked for get resource yaml.")
306+
raise ActionException(ErrorCodes.RESOURCE_NOT_PERMITTED, f"{resource_kind.lower()} type is blocked for get resource yaml.")
307307

308308
try:
309309
resource_yaml = hikaru.get_yaml(resource)

src/robusta/utils/error_codes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ErrorCodes(Enum):
2525
RESOURCE_NOT_SUPPORTED = 4701
2626
RESOURCE_NOT_FOUND = 4702
2727
ILLEGAL_ACTION_PARAMS = 4703
28+
RESOURCE_NOT_PERMITTED = 4704
2829

2930
ALERT_MANAGER_DISCOVERY_FAILED = 5000
3031
ALERT_MANAGER_REQUEST_FAILED = 5001

0 commit comments

Comments
 (0)