Skip to content

Commit 4091870

Browse files
committed
fix: fail on login
1 parent 33f5da4 commit 4091870

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

utilities/infra.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from utilities.constants import ApiGroups, Labels, Timeout
4040
from utilities.constants import KServeDeploymentType
4141
from utilities.constants import Annotations
42-
from utilities.exceptions import FailedPodsError
42+
from utilities.exceptions import ClusterLoginError, FailedPodsError
4343
from timeout_sampler import TimeoutExpiredError, TimeoutSampler, retry
4444
import utilities.general
4545

@@ -328,7 +328,10 @@ def login_with_user_password(api_address: str, user: str, password: str | None =
328328
if password:
329329
login_command += f" -p '{password}'"
330330

331-
_, out, _ = run_command(command=shlex.split(login_command), hide_log_command=True)
331+
_, out, err = run_command(command=shlex.split(login_command), hide_log_command=True)
332+
333+
if err and err.lower().startswith("error"):
334+
raise ClusterLoginError(user=user)
332335

333336
if re.search(r"Login successful|Logged into", out):
334337
return True

0 commit comments

Comments
 (0)