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-agent.ps1 script requires JENKINS_URL to be set, making it incompatible with JENKINS_DIRECT_CONNECTION #590

Closed
krische opened this issue Jun 21, 2023 · 0 comments · Fixed by jenkinsci/docker-inbound-agent#361

Comments

@krische
Copy link
Contributor

krische commented Jun 21, 2023

Jenkins and plugins versions report

Environment
Jenkins: 2.411
OS: Linux - 5.15.0-1039-azure
Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
kubernetes:3950.v581298fa_e4e7

What Operating System are you using (both controller, and any agents involved in the problem)?

  • Controller is the official container image running in kubernetes
  • The agent is the inbound-agent container image from the most recent jdk11-nanoserver-1809 (3131.vf2b_b_798b_ce99-1-jdk11-nanoserver-1809)

Reproduction steps

  1. Install the kubernetes plugin and configure it to a cluster with "Direct Connection" enabled.
  2. Try to create a windows inbound agent.
  • It will fail to startup because it throws an error that JENKINS_URL is not defined.
  • If you manually define this in your pod template, then it will fail because JENKINS_URL and JENKINS_DIRECT_CONNECTION cannot both be set.

Expected Results

I should be able to connect with "Direct Connection" using the Windows inbound-agent like I can the linux ones.

Actual Results

  • It will fail to startup because it throws an error that JENKINS_URL is not defined.
  • If you manually define JENKINS_URL in your pod template, then it will fail because JENKINS_URL and JENKINS_DIRECT_CONNECTION cannot both be set.

Anything else?

The root of the issue appears to be on line 26 on jenkins-agent.ps1 in that it requires JENKINS_URL environment variable to always be set.

This is different to the behavior of the bash script and it also means that it is not possible to use "Direct Connection" (JNLP) with the windows inbound agent image.

@krische krische added the bug label Jun 21, 2023
krische referenced this issue in krische/docker-inbound-agent Jun 28, 2023
This fixes #358 by only requiring `JENKINS_URL` have a value when `JENKINS_DIRECT_CONNECTION` is not set as well.
lemeurherve referenced this issue in lemeurherve/jenkinsci-docker-inbound-agent Nov 19, 2023
…in /17/bullseye (#358)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@lemeurherve lemeurherve transferred this issue from jenkinsci/docker-inbound-agent Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants