Skip to content

Fix hostname resolution in recent Jenkins versions#326

Merged
albertvaka merged 4 commits into
masterfrom
albertvaka/support-node-name-built-in
Feb 10, 2023
Merged

Fix hostname resolution in recent Jenkins versions#326
albertvaka merged 4 commits into
masterfrom
albertvaka/support-node-name-built-in

Conversation

@albertvaka

Copy link
Copy Markdown
Collaborator

What does this PR do?

The main worker got renamed from "master" to "built-in" in recent Jenkins versions. Adds support for both names.

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

The main worker got renamed from "master" to "built-in".
// If there is no labels and the node name is master,
// we force the label "master".
if("master".equalsIgnoreCase(nodeName)){
if("master".equalsIgnoreCase(nodeName) || "built-in".equalsIgnoreCase(nodeName)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be worth it to have this method in a utility method. It seems we're repeating the same checks multiple times

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@albertvaka
albertvaka merged commit c8c9b3f into master Feb 10, 2023
@albertvaka
albertvaka deleted the albertvaka/support-node-name-built-in branch February 10, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants