Skip to content
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

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

MattLud
Copy link
Contributor

@MattLud MattLud commented Nov 7, 2019

@MattLud MattLud force-pushed the make_labels_nonunique branch 4 times, most recently from 230fc97 to 81009be Compare November 15, 2019 16:55
@MattLud
Copy link
Contributor Author

MattLud commented Nov 15, 2019

Passing now but I want point out this has a breaking change where labels with violating character requirements will fail.

@Vlatombe
Copy link
Member

Need to sanitize label maybe?

@MattLud
Copy link
Contributor Author

MattLud commented Nov 15, 2019

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.

@Vlatombe
Copy link
Member

Vlatombe commented Nov 18, 2019

generated labels should be safe already

int max = /* Kubernetes limit */ 63 - /* hyphen */ 1 - /* suffix */ 5;

@MattLud MattLud marked this pull request as ready for review December 3, 2019 20:48
@MattLud
Copy link
Contributor Author

MattLud commented Dec 3, 2019

Moving this out of draft now - feel free to merge.

@@ -112,5 +112,5 @@ public String toString() {
public String getDisplayName() {
return "Pod Label";
}
}
}
Copy link
Member

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.

@jglick jglick changed the title JENKINS-60088: move k8s pod build label from key to value; minor whit… JENKINS-60088: move k8s pod build label from key to value Dec 3, 2019
@MattLud MattLud force-pushed the make_labels_nonunique branch from 81009be to 377e465 Compare December 12, 2019 22:13
making labels require compliant format - no / or other characters
allowed

Change-Id: I39bdfde4a03abaacd0aa87222a190935ab5f45c4
@MattLud MattLud force-pushed the make_labels_nonunique branch from 377e465 to d990ac6 Compare December 12, 2019 22:20
@Vlatombe Vlatombe changed the title JENKINS-60088: move k8s pod build label from key to value [JENKINS-60088] set label jenkins/label=<label> instead of jenkins/<label>=true Dec 13, 2019
@Vlatombe Vlatombe changed the title [JENKINS-60088] set label jenkins/label=<label> instead of jenkins/<label>=true [JENKINS-60088] set label "jenkins/label=<label>" instead of "jenkins/<label>=true" Dec 13, 2019
@Vlatombe Vlatombe added enhancement Improvements ready labels Dec 13, 2019
@Vlatombe Vlatombe merged commit 33b9ee2 into jenkinsci:master Dec 13, 2019
@fraz3alpha
Copy link

Can you provide an example pipeline?

@MattLud

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:

Screenshot 2019-12-18 at 17 56 53

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.

@Vlatombe
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants