Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ def pre_operations(self):
def get_health_probe_settings(enable_health_probe, probe_interval_in_seconds,
probe_path, probe_protocol, probe_request_type):
params = [probe_interval_in_seconds, probe_path, probe_protocol, probe_request_type]
if enable_health_probe is False:
return None
if enable_health_probe is True:
if any(param is None for param in params):
raise InvalidArgumentValueError(
Expand Down Expand Up @@ -410,23 +412,29 @@ def pre_operations(self):
enable_health_probe = False
else:
enable_health_probe = True
else:
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

The logic reassigns 'enable_health_probe' in multiple conditional blocks, which may lead to inconsistent behavior. Consider refactoring by computing 'enable_health_probe' once and using a consistent approach for updating probe settings.

Copilot uses AI. Check for mistakes.
enable_health_probe = args.enable_health_probe.to_serialized_data()

if has_value(args.probe_path):
enable_health_probe = True
probe_path = args.probe_path.to_serialized_data()
elif 'probePath' in existing['healthProbeSettings']:
probe_path = existing['healthProbeSettings']['probePath']

if has_value(args.probe_protocol):
enable_health_probe = True
probe_protocol = args.probe_protocol.to_serialized_data()
elif 'probeProtocol' in existing['healthProbeSettings']:
probe_protocol = existing['healthProbeSettings']['probeProtocol']

if has_value(args.probe_interval_in_seconds):
enable_health_probe = True
probe_interval_in_seconds = args.probe_interval_in_seconds.to_serialized_data()
elif 'probeIntervalInSeconds' in existing['healthProbeSettings']:
probe_interval_in_seconds = existing['healthProbeSettings']['probeIntervalInSeconds']

if has_value(args.probe_request_type):
enable_health_probe = True
probe_request_type = args.probe_request_type.to_serialized_data()
elif 'probeRequestType' in existing['healthProbeSettings']:
probe_request_type = existing['healthProbeSettings']['probeRequestType']
Expand Down
Loading
Loading