[JENKINS-53422] Declarative: do not wrap steps with container
statement unless default container is changed
#377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We met a weird issue when migrating the scripted syntax to declarative
with Kubernetes plugin: The
Launcher
doesn't forwardstdin
,stdout
, orstderr
even though they are requested to be forwarded.This breaks many plugins that use
Launcher
to start a remote process on Jenkins slaves.This happens because when Kubernetes plugin converts declarative syntax to scripted syntax,
all build steps are enclosed with a
container
statement.As a result, remote commands are run via the Kubernetes exec API rather than
the jnlp agent.
Since running steps via Kubernetes exec API is still considered ALPHA
and there are some compatibility issues to solve,
I would like to make a small change to the syntax converting process:
The declarative steps will not be enclosed with a
container
statement unlessan alternate default container is specified by the pipeline user.
Issue link: https://issues.jenkins-ci.org/browse/JENKINS-53422