Description
On non-Windows platforms, shutil.which("kubectl") returns None if the
executable is not found. The code then calls os.path.dirname(full_path)
which will raise TypeError: expected str, bytes or os.PathLike object, not NoneType.
This will crash at runtime when kubectl is not installed.
Severity: high
File: installer/common/file_utils.py
Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Description
On non-Windows platforms,
shutil.which("kubectl")returnsNoneif theexecutable is not found. The code then calls
os.path.dirname(full_path)which will raise
TypeError: expected str, bytes or os.PathLike object, not NoneType.This will crash at runtime when kubectl is not installed.
Severity:
highFile:
installer/common/file_utils.pyExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.