[JIRA] (JENKINS-56442) Use agent slave pod label value instead of key

2019-03-08 Thread todd.ly...@pgi.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Todd Lyons commented on  JENKINS-56442  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Use agent slave pod label value instead of key   
 

  
 
 
 
 

 
 I had considered this as another possible option: ``` 

 

$ git diff src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
index 4cdecb0..74881fe 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
@@ -360,6 +360,7 @@ public class PodTemplate extends AbstractDescribableImpl implements
 if (!labelSet.isEmpty()) {
  for (LabelAtom label : labelSet) {
    // builder.put(label == null ? DEFAULT_ID : "jenkins/" + label.getName(), "true");
+   builder.put(label == null ? DEFAULT_ID : "jenkins_build", label.getName());
  }
 }
 return builder.build(); 

 ``` But I felt it was kind of stupid to even consider maintaining my own mods to a jenkins plugin, and instead make the log shipper do the transformation work. I struggle with the `if (!labelSet.isEmpty())` logic, and the getLabelsMap() in general.  I think if we can specify our own label, probably in the config where we define the Kube “cloud”, it would possibly get around all of this. I never explored if there is in fact a way to do that from the config UI (or even if I was properly reading that function).  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 

[JIRA] (JENKINS-56442) Use agent slave pod label value instead of key

2019-03-08 Thread todd.ly...@pgi.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Todd Lyons commented on  JENKINS-56442  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Use agent slave pod label value instead of key   
 

  
 
 
 
 

 
 I too had to work through this in Dec 2018 and worked with Eric in the slack channel discussing it.  I couldn't get it to work with logstash and filebeats, in any combination.  Instead in the Kube stack that runs our Jenkins builders, I had to install and configure fluentd and use inline ruby scripting to morph the fields.  I had to capture everything after the `jenkins/(.+)`, create a new key "jenkins_build=$1".  What I had to do to accomplish it is documented here: https://gist.github.com/mrballcb/c1a8ff4132224e654e85aad80f3a0fec  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.