a2l007 commented on code in PR #13655:
URL: https://github.com/apache/druid/pull/13655#discussion_r1084494591
##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/common/K8sTaskAdapter.java:
##########
@@ -275,4 +280,28 @@ protected PodTemplateSpec createTemplateFromSpec(
return podTemplate;
}
+ @VisibleForTesting
+ static void massageSpec(PodSpec spec, String primaryContainerName)
+ {
+ // find the primary container and make it first,
+ if (StringUtils.isNotBlank(primaryContainerName)) {
+ int i = 0;
+ while (i < spec.getContainers().size()) {
+ if
(primaryContainerName.equals(spec.getContainers().get(i).getName())) {
+ break;
+ }
+ i++;
+ }
+ // if the primaryContainer is not found, assume the primary container is
the first container.
+ if (i >= spec.getContainers().size()) {
+ throw new IllegalArgumentException("Could not find container named: "
Review Comment:
Should we just log the error here instead of throwing it?
--
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]