Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2170791
Sketch of `ContainerListenDecorator`
jglick May 20, 2026
a257bd1
SpotBugs
jglick May 21, 2026
7130253
NPE in `PodTemplateBuilderTest`
jglick May 21, 2026
d4706f2
At least basic handling of env vars
jglick May 21, 2026
f85935f
Properly quote `LOC`
jglick May 21, 2026
79de706
`test` rather than `-f` maybe clearer
jglick May 21, 2026
455e199
Use container env for clarity
jglick May 21, 2026
b58c5c9
Preparing a bootstrap system
jglick May 21, 2026
ab2b091
Filter environment variables in ContainerListenDecorator
jglick May 21, 2026
4060416
Stylistic cleanups
jglick May 21, 2026
95b67da
Easier to read multiline script
jglick May 21, 2026
368dc88
Noting constraints on shell script
jglick May 21, 2026
d6d37b0
stdio (and exit code) working
jglick May 21, 2026
e8f98d3
Clean up the proc dir when we are done with it
jglick May 21, 2026
9370a27
Suppressing irrelevant test
jglick May 21, 2026
05f48d7
`KubernetesDeclarativeAgentTest.declarativeFromYamlWithNullEnv` was g…
jglick May 21, 2026
e178652
`RestartPipelineTest.terminatedPodAfterRestart` passed though decorat…
jglick May 21, 2026
27244b7
Containers may use a different mount path for the workspace, or have …
jglick May 22, 2026
ea5a7c0
Quieter bootstrap script
jglick May 22, 2026
0455475
Always `undecorate` the launcher, in case `container` step is used in…
jglick May 22, 2026
741b23e
Silly result of IDE convert anon inner to nested
jglick May 22, 2026
e444656
Simpler way of finding `Pod`
jglick May 22, 2026
f8613b0
Noting to Claude how to run tests
jglick May 26, 2026
4b496c7
`ContainerExecDecoratorPipelineTest.docker` asserts `maskedPrintComma…
jglick May 26, 2026
07ad3c6
`KubernetesDeclarativeAgentTest.declarativeWithNestedExplicitInherita…
jglick May 26, 2026
6a6bbc0
Merge branch 'master' of https://github.com/jenkinsci/kubernetes-plug…
jglick May 28, 2026
93b304a
`KubernetesPipelineTest#runWithEnvVariablesInContext` covers `BASH_CO…
jglick May 28, 2026
41e46f7
`KubernetesPipelineTest#runInPod` as of #244 was getting confused by …
jglick May 28, 2026
9d17d01
`KubernetesPipelineTest#interruptedPod` fixed by implementing `Launch…
jglick May 28, 2026
25278c5
Pick up https://github.com/jenkinsci/jenkins-test-harness/pull/1175
jglick May 28, 2026
ee5a90b
Straightforward enough to handle `ContainerStep.shell` correctly, but…
jglick May 29, 2026
964ba3f
https://github.com/jenkinsci/durable-task-plugin/pull/561 released
jglick Jul 7, 2026
b2575f5
Switch from system property to cloud flag
jglick Jul 7, 2026
467ee14
Gratuitous modifiers
jglick Jul 7, 2026
6af12ad
Merge branch 'ltsc2022' into ContainerStepExecution
jglick Jul 8, 2026
517182b
Politely falling back to original impl on Windows
jglick Jul 8, 2026
4b467c3
Noting new mode in README
jglick Jul 8, 2026
f238341
Merge branch 'master' into ContainerStepExecution
jglick Jul 9, 2026
6d61b6a
Merge branch 'ltsc2022' into ContainerStepExecution
jglick Jul 9, 2026
d8cf4d7
Merge branch 'master' into ContainerStepExecution
jglick Jul 13, 2026
3ca3f27
Revert "Straightforward enough to handle `ContainerStep.shell` correc…
jglick Jul 13, 2026
2a9b72c
Disable by default; introduce dedicated test class; tone down logging
jglick Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
All tests in this plugin which touch an actual Kubernetes cluster (mainly those extending @src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/AbstractKubernetesPipelineTest.java) require you to pass `-Pktunnel` to Maven.
Also use `-DforkCount=1` when running multiple cluster-based test classes at once to disable concurrency, since the tests use fixed port numbers.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ The container specified by `agentContainer` will be the one where shell steps (o

To execute commands in another container part of the pod (different from the one running the Jenkins agent), you can use the `container` step.

**Note**

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

was misformatted

---
Due to implementation constraints, there can be issues when executing commands in different containers if they run using different uids.
It is recommended to use the same uid across the different containers part of the same pod to avoid any issue.
---
> [!NOTE]
> Due to implementation constraints, there can be issues when executing commands in different containers if they run using different uids.
> It is recommended to use the same uid across the different containers part of the same pod to avoid any issue.

> [!NOTE]
> The default implementation of the `container` step does not scale well.
> Consider selecting the **Use active containers** option in cloud configuration for a more efficient mode.

```groovy
podTemplate(
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<spotless.check.skip>false</spotless.check.skip>
<ban-junit4-imports.skip>false</ban-junit4-imports.skip>
<banObsoleteDependencyOverrides.skip>false</banObsoleteDependencyOverrides.skip>
<jenkins-test-harness.version>2573.vd91b_8a_43e019</jenkins-test-harness.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ public class KubernetesCloud extends Cloud implements PodTemplateGroup {
@CheckForNull
private GarbageCollection garbageCollection;

/** @see ContainerListenDecorator */
private boolean activeContainers;

@NonNull
private DescribableList<KubernetesCloudTrait, KubernetesCloudTraitDescriptor> traits =
new DescribableList<>(Saveable.NOOP);
Expand Down Expand Up @@ -377,6 +380,14 @@ public void setGarbageCollection(GarbageCollection garbageCollection) {
this.garbageCollection = garbageCollection;
}

public boolean isActiveContainers() {
return activeContainers;
}

@DataBoundSetter
public void setActiveContainers(boolean activeContainers) {
this.activeContainers = activeContainers;
}
/**
* Get list of traits enabled for this cloud.
* @return configured traits, never null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class PodTemplateBuilder {

private static final Logger LOGGER = Logger.getLogger(PodTemplateBuilder.class.getName());

private static final String WORKSPACE_VOLUME_NAME = "workspace-volume";
public static final String WORKSPACE_VOLUME_NAME = "workspace-volume";
public static final Pattern FROM_DIRECTIVE = Pattern.compile("^FROM (.*)$");

public static final String LABEL_KUBERNETES_CONTROLLER = "kubernetes.jenkins.io/controller";
Expand Down
Loading