Skip to content

Commit

Permalink
fix(deployment): set replica=0 as default in deployment logs command
Browse files Browse the repository at this point in the history
The replica value defaults to None in the existing implementation which
results in a wrong value sent in the query parameter. This commit fixes
the issue by setting the default to 0.

Wrike Ticket: https://www.wrike.com/open.htm?id=1478463257
  • Loading branch information
pallabpain committed Sep 4, 2024
1 parent c6e7a8b commit e9f4668
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions riocli/deployment/logs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Rapyuta Robotics
# Copyright 2024 Rapyuta Robotics
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os

import click
from click_help_colors import HelpColorsCommand
Expand All @@ -26,20 +25,21 @@
help_headers_color=Colors.YELLOW,
help_options_color=Colors.GREEN,
)
@click.option('--replica', 'replica', default=None,
@click.option('--replica', 'replica', default=0,
help='Replica identifier of the deployment')
@click.option('--exec', 'exec_name', default=None,
help='Name of a executable in the component')
@click.argument('deployment-name', type=str)
def deployment_logs(
replica: str,
replica: int,
exec_name: str,
deployment_name: str,
) -> None:
"""
Stream live logs from cloud deployments (not supported for device deployments)
"""
try:
# TODO(pallab): when no exec name is given, implement the logic to set default or prompt a selection.
client = new_v2_client()
client.stream_deployment_logs(deployment_name, exec_name, replica)
except Exception as e:
Expand Down

0 comments on commit e9f4668

Please sign in to comment.