|
10 | 10 | from hikaru.model.rel_1_26 import Container, EnvVar, EnvVarSource, PodSpec, ResourceRequirements, SecretKeySelector |
11 | 11 | from prometrix import AWSPrometheusConfig, CoralogixPrometheusConfig, PrometheusAuthorization, PrometheusConfig |
12 | 12 | from pydantic import BaseModel, ValidationError, validator |
13 | | - |
14 | 13 | from robusta.api import ( |
15 | 14 | IMAGE_REGISTRY, |
16 | 15 | RUNNER_SERVICE_ACCOUNT, |
|
32 | 31 | from robusta.core.reporting.consts import ScanState |
33 | 32 | from robusta.integrations.openshift import IS_OPENSHIFT |
34 | 33 | from robusta.integrations.prometheus.utils import generate_prometheus_config |
| 34 | +from robusta.utils.parsing import format_event_templated_string |
35 | 35 |
|
36 | 36 | IMAGE: str = os.getenv("KRR_IMAGE_OVERRIDE", f"{IMAGE_REGISTRY}/krr:v1.23.0") |
37 | 37 | KRR_MEMORY_LIMIT: str = os.getenv("KRR_MEMORY_LIMIT", "2Gi") |
@@ -279,8 +279,13 @@ def krr_scan(event: ExecutionBaseEvent, params: KRRParams): |
279 | 279 | scan_id = str(uuid.uuid4()) |
280 | 280 | prom_config = generate_prometheus_config(params) |
281 | 281 | additional_flags = get_krr_additional_flags(params) |
| 282 | + args_sanitized = params.args_sanitized |
| 283 | + |
| 284 | + if params.args_sanitized and hasattr(event, "obj") and event.obj is not None: |
| 285 | + subject = event.get_subject() |
| 286 | + args_sanitized = format_event_templated_string(subject, params.args_sanitized) |
282 | 287 |
|
283 | | - python_command = f"python krr.py {params.strategy} {params.args_sanitized} {additional_flags} " |
| 288 | + python_command = f"python krr.py {params.strategy} {args_sanitized} {additional_flags} " |
284 | 289 | verbose_str = "-v" if params.krr_verbose else "" |
285 | 290 | python_command += f"--max-workers {params.max_workers} {verbose_str} -f json --width 2048" |
286 | 291 |
|
|
0 commit comments