-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-60088] set label "jenkins/label=<label>" instead of "jenkins/<label>=true" #640
Conversation
src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
Outdated
Show resolved
Hide resolved
230fc97
to
81009be
Compare
Passing now but I want point out this has a breaking change where labels with violating character requirements will fail. |
Need to sanitize label maybe? |
It may not need sanitizing - it uses the build name, which already gets rejected if it fails the naming regex that applies here. Only reason to sanitize is to meet the 63 character limit which I can add in and provide a test if desired. |
generated labels should be safe already Line 167 in 3f91dcd
|
Moving this out of draft now - feel free to merge. |
@@ -112,5 +112,5 @@ public String toString() { | |||
public String getDisplayName() { | |||
return "Pod Label"; | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind reverting unrelated whitespace changes? The patch to src/main/
should be one line.
src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
Outdated
Show resolved
Hide resolved
81009be
to
377e465
Compare
making labels require compliant format - no / or other characters allowed Change-Id: I39bdfde4a03abaacd0aa87222a190935ab5f45c4
377e465
to
d990ac6
Compare
We have the same issue on all the Jenkins instance where we have upgraded to 1.22.1, our default pod template in the cloud configuration (in Manage / Configure) has two labels, but gives the duplicate label error. We can get it to work by removing all but one of them, e.g. to leave: Our test pipeline that requires this template only specifies a single label - so it's a trivial test case from the pipeline end, but the template it needs to start will fail to do so if it has more than one label defined. This has unfortunately meant we have had to remove all the useful matrix labelling in this instance, so we can't leave it like this, and will have to stay on the downgraded plugin until this is fixed and multiple labels are supported again. |
JENKINS-60088