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


##########
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:
   Thanks for highlighting this. There are some driver labels which are not 
supposed to be overridden by downstream resources.
   
   I can refactor the code so that:
   * There is a label exclusion list (regex based).
   * While re-applying the resource labels back, exclude the ones mentioned in 
exclusion list.
   
   Proposed exclusion: regex based (**starts with either "spark.operator" _OR_ 
"spark-"** )
   
   Please let me know if this would be okay?
   cc: @dongjoon-hyun 



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