Copilot commented on code in PR #7214:
URL: https://github.com/apache/kyuubi/pull/7214#discussion_r2380179636
##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala:
##########
@@ -685,7 +686,8 @@ object KubernetesApplicationOperation extends Logging {
def containerStateToApplicationState(containerState: ContainerState):
ApplicationState = {
//
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-states
if (containerState.getWaiting != null) {
- PENDING
+ val reasonOpt =
Option(containerState.getWaiting.getReason).map(_.trim).filter(_.nonEmpty)
+ if (reasonOpt.isEmpty ||
PENDING_WAITING_REASONS.contains(reasonOpt.get)) PENDING else FAILED
Review Comment:
[nitpick] The complex conditional logic on a single line reduces
readability. Consider extracting the reason checking into a separate method or
splitting into multiple lines for better maintainability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]