ssirowa14 commented on code in PR #925:
URL: 
https://github.com/apache/spark-kubernetes-operator/pull/925#discussion_r4199989185


##########
spark-operator/src/main/java/org/apache/spark/k8s/operator/decorators/DriverResourceDecorator.java:
##########
@@ -73,6 +73,10 @@ public <T extends HasMetadata> T decorate(T resource) {
           new ObjectMetaBuilder(resource.getMetadata())
               .addToOwnerReferences(buildOwnerReferenceTo(driverPod))
               .addToLabels(driverPod.getMetadata().getLabels())
+              // Re-apply the resource's own labels last so a label set 
explicitly on
+              // the resource (e.g. a per-service label) wins over the 
driver-pod label
+              // of the same key, rather than being overwritten by it.
+              .addToLabels(resource.getMetadata().getLabels())

Review Comment:
   Refactored the code. Now, we have an exclusion list of labels:
   * driver and resource both set the label from exclusion list. Driver wins.
   * driver and resource both set the label NOT IN exclusion list. Resource 
label wins.



-- 
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]

Reply via email to