-
Notifications
You must be signed in to change notification settings - Fork 690
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
Tag slave instances to their jenkins master #274
Tag slave instances to their jenkins master #274
Conversation
…o distinguish them between masters.
Even so it creates a very big conflict with my PR (#252), it would be very good to have something like this in place. Few things on top of review:
At the end, in current state PR should work if user does not:
|
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.
As I'm not a maintainer, my comments can be easily ignored :)
Let's wait feedback from @francisu
@@ -383,6 +389,9 @@ private int countCurrentEC2Slaves(SlaveTemplate template) throws AmazonClientExc | |||
filters.add(new Filter("launch.image-id", values)); | |||
} | |||
|
|||
// The instances must match the jenkins server url | |||
filters.add(new Filter("tag:" + EC2Tag.TAG_NAME_JENKINS_SERVER_URL + "=" + jenkinsServerUrl)); |
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.
if user specified EC2Tag.TAG_NAME_JENKINS_SERVER_URL
manually, this line will break instance cap calculation.
@@ -475,6 +484,15 @@ private int countCurrentEC2Slaves(SlaveTemplate template) throws AmazonClientExc | |||
return n; | |||
} | |||
|
|||
private boolean isEc2ProvisionedJenkinsSlave(List<Tag> tags, String serverUrl) { |
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.
imho, it would be better to use getCustomInstanceTags
here and compare list of tags from instance with expected tags.
This replaces PR #271 that had the wrong starting branch.
In the case where you have multiple Jenkins masters using the same configuration (same AMI for multiple clouds), the instance cap is shared between all instances and clouds. The workaround is to add an additional tag with the Jenkins url to have this instance cap unique per Jenkins master.