Skip to content

Support parameterized DockerCloud agent images - #1360

Draft
hshibuya-dd wants to merge 1 commit into
jenkinsci:masterfrom
hshibuya-dd:hshibuya/parameterized-agent-image
Draft

Support parameterized DockerCloud agent images#1360
hshibuya-dd wants to merge 1 commit into
jenkinsci:masterfrom
hshibuya-dd:hshibuya/parameterized-agent-image

Conversation

@hshibuya-dd

Copy link
Copy Markdown

Allow DockerCloud agent template images to reference Jenkins build parameters, for example:

registry.example.com/ci/build-agent:${IMAGE_TAG}

This lets a job use its default image tag for normal builds while selecting an isolated pull request image tag, such as pr-1234, for targeted validation.

Implementation:

  • Resolve parameter values when a queue item enters the waiting state.
  • Clone parameterized templates per queue item instead of mutating persisted DockerCloud configuration.
  • Preserve the configured template's container settings, connector, pull strategy, timeouts, limits, retention strategy, and node properties.
  • Assign each temporary template a unique label so concurrent builds do not share image selections.
  • Remove temporary templates when queue items leave the queue.
  • Cancel queue items whose temporary Docker image cannot be provisioned, so failed image pulls do not remain queued indefinitely.
  • Ignore missing or empty parameter values rather than constructing an invalid image reference.
  • Document parameterized image configuration in the README and image help text.

Tests:

  • Verify image parameter expansion to a pull request tag.
  • Verify missing and empty parameters leave the image unresolved.
  • Verify cloned templates retain their configured settings while replacing the image and label.

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@hshibuya-dd
hshibuya-dd requested a review from a team as a code owner August 18, 2026 19:41
Allow DockerCloud agent template images to reference Jenkins build parameters,
for example:

    registry.example.com/ci/build-agent:${IMAGE_TAG}

This lets a job use its default image tag for normal builds while selecting an
isolated pull request image tag, such as `pr-1234`, for targeted validation.

Implementation:

- Resolve parameter values when a queue item enters the waiting state.
- Clone parameterized templates per queue item instead of mutating persisted
  DockerCloud configuration.
- Preserve the configured template's container settings, connector, pull
  strategy, timeouts, limits, retention strategy, and node properties.
- Assign each temporary template a unique label so concurrent builds do not
  share image selections.
- Remove temporary templates when queue items leave the queue.
- Cancel queue items whose temporary Docker image cannot be provisioned, so
  failed image pulls do not remain queued indefinitely.
- Ignore missing or empty parameter values rather than constructing an invalid
  image reference.
- Document parameterized image configuration in the README and image help text.

Tests:

- Verify image parameter expansion to a pull request tag.
- Verify missing and empty parameters leave the image unresolved.
- Verify cloned templates retain their configured settings while replacing the
  image and label.
@hshibuya-dd
hshibuya-dd force-pushed the hshibuya/parameterized-agent-image branch from 826d3c1 to 0a23db0 Compare August 18, 2026 19:56
@hshibuya-dd
hshibuya-dd marked this pull request as draft August 18, 2026 20:10
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.

1 participant