|
27 | 27 | TableBlock, |
28 | 28 | action, |
29 | 29 | ) |
| 30 | +from robusta.integrations.kubernetes.custom_models import PYTHON_DEBUGGER_IMAGE |
30 | 31 | from robusta.utils.parsing import load_json |
31 | 32 |
|
32 | 33 |
|
@@ -68,6 +69,10 @@ def python_profiler(event: PodEvent, action_params: StartProfilingParams): |
68 | 69 | # This should use ephemeral containers, but they aren't in GA yet. To enable them on GCP for example, |
69 | 70 | # you need to create a brand new cluster. Therefore we're sticking with regular containers for now |
70 | 71 | pod = event.get_pod() |
| 72 | + if "debug-toolkit:v6.0" not in PYTHON_DEBUGGER_IMAGE: |
| 73 | + logging.error(f"The python_profiler action is deprecated " |
| 74 | + f"to run set the PYTHON_DEBUGGER_IMAGE environment variable to debug-toolkit:v6.0.") |
| 75 | + return |
71 | 76 | logging.warning(f"The python_profiler action is deprecated and might not work on all platforms.") |
72 | 77 | if not pod: |
73 | 78 | logging.info(f"python_profiler - pod not found for event: {event}") |
@@ -179,8 +184,11 @@ def python_memory(event: PodEvent, params: MemoryTraceParams): |
179 | 184 |
|
180 | 185 | Use this to track memory leaks in your Python application on Kubernetes. |
181 | 186 | """ |
| 187 | + if "debug-toolkit:v6.0" not in PYTHON_DEBUGGER_IMAGE: |
| 188 | + logging.error(f"The python_memory action is deprecated and might not work on all platforms. " |
| 189 | + f"to enable it set the PYTHON_DEBUGGER_IMAGE environment variable to debug-toolkit:v6.0.") |
| 190 | + return |
182 | 191 | pod = event.get_pod() |
183 | | - logging.warning(f"The python_memory action is deprecated and might not work on all platforms.") |
184 | 192 | if not pod: |
185 | 193 | logging.info(f"python_memory - pod not found for event: {event}") |
186 | 194 | return |
@@ -296,7 +304,10 @@ def debugger_stack_trace(event: PodEvent, params: StackTraceParams): |
296 | 304 | Create a finding with the stack trace results. |
297 | 305 | """ |
298 | 306 | pod = event.get_pod() |
299 | | - logging.warning(f"The debugger_stack_trace action is deprecated and might not work on all platforms.") |
| 307 | + if "debug-toolkit:v6.0" not in PYTHON_DEBUGGER_IMAGE: |
| 308 | + logging.error(f"The debugger_stack_trace action is deprecated and might not work on all platforms. " |
| 309 | + f"to enable it set the PYTHON_DEBUGGER_IMAGE environment variable to debug-toolkit:v6.0.") |
| 310 | + return |
300 | 311 | if not pod: |
301 | 312 | logging.info(f"debugger_stack_trace - pod not found for event: {event}") |
302 | 313 | return |
@@ -381,6 +392,10 @@ def python_process_inspector(event: PodEvent, params: DebuggerParams): |
381 | 392 | Create a finding with alternative debugging options for received processes ; i.e. Stack-trace or Memory-trace. |
382 | 393 |
|
383 | 394 | """ |
| 395 | + if "debug-toolkit:v6.0" not in PYTHON_DEBUGGER_IMAGE: |
| 396 | + logging.error(f"The python_process_inspector action is deprecated and might not work on all platforms. " |
| 397 | + f"to enable it set the PYTHON_DEBUGGER_IMAGE environment variable to debug-toolkit:v6.0.") |
| 398 | + return |
384 | 399 | pod = event.get_pod() |
385 | 400 | logging.warning(f"The python_process_inspector action is deprecated and might not work on all platforms.") |
386 | 401 | if not pod: |
@@ -440,6 +455,10 @@ def python_debugger(event: PodEvent, params: DebuggerParams): |
440 | 455 |
|
441 | 456 | Now you can use break points and log points in VSCode. |
442 | 457 | """ |
| 458 | + if "debug-toolkit:v6.0" not in PYTHON_DEBUGGER_IMAGE: |
| 459 | + logging.error(f"The python_debugger action is deprecated and might not work on all platforms. " |
| 460 | + f"to enable it set the PYTHON_DEBUGGER_IMAGE environment variable to debug-toolkit:v6.0.") |
| 461 | + return |
443 | 462 | pod = event.get_pod() |
444 | 463 | logging.warning(f"The python_debugger action is deprecated and might not work on all platforms.") |
445 | 464 | if not pod: |
|
0 commit comments