Skip to content

Add helper script for kuberay rbac#250

Closed
hemildesai wants to merge 4 commits intomainfrom
hemil/kuberay-rbac
Closed

Add helper script for kuberay rbac#250
hemildesai wants to merge 4 commits intomainfrom
hemil/kuberay-rbac

Conversation

@hemildesai
Copy link
Copy Markdown
Contributor

Run using kuberay-rbac after installing nemo-run.

Start with kuberay-rbac --help

Signed-off-by: Hemil Desai <hemild@nvidia.com>
Signed-off-by: Hemil Desai <hemild@nvidia.com>
terrykong
terrykong previously approved these changes Jun 5, 2025
Copy link
Copy Markdown

@terrykong terrykong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm. but out of curiosity, would the code be more succinct if you used rich instead of manually doing the ansi color codes?

Signed-off-by: Hemil Desai <hemild@nvidia.com>
)
if result.returncode == 0 and result.stdout.strip():
return result.stdout.strip()
except Exception:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

Copilot Autofix

AI 10 months ago

To fix the issue, the except Exception: block should log the exception using the existing print_error function. This ensures that any errors encountered during the execution of the subprocess.run command are visible to the user, aiding in debugging and transparency. The fallback behavior (return "default") can remain unchanged, as it provides a reasonable default in case of failure.

Steps to implement the fix:

  1. Modify the except Exception: block to log the exception using print_error.
  2. Include the exception message in the log for better debugging.
  3. Ensure the fallback behavior (return "default") remains intact.

Suggested changeset 1
nemo_run/tools/kuberay_rbac.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/nemo_run/tools/kuberay_rbac.py b/nemo_run/tools/kuberay_rbac.py
--- a/nemo_run/tools/kuberay_rbac.py
+++ b/nemo_run/tools/kuberay_rbac.py
@@ -62,4 +62,4 @@
             return result.stdout.strip()
-    except Exception:
-        pass
+    except Exception as e:
+        print_error(f"Failed to retrieve default namespace: {e}")
 
EOF
@@ -62,4 +62,4 @@
return result.stdout.strip()
except Exception:
pass
except Exception as e:
print_error(f"Failed to retrieve default namespace: {e}")

Copilot is powered by AI and may make mistakes. Always verify output.
terrykong
terrykong previously approved these changes Jun 5, 2025
Signed-off-by: Hemil Desai <hemild@nvidia.com>
@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants