-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
handle null retention policy resulting from direct xml pod template i… #381
Conversation
…njection (seen during agent termination)
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better fix would be to add the default pod retention policy upon deserialization in
kubernetes-plugin/src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplate.java
Lines 628 to 644 in ecc2312
protected Object readResolve() { | |
if (containers == null) { | |
// upgrading from 0.8 | |
containers = new ArrayList<>(); | |
ContainerTemplate containerTemplate = new ContainerTemplate(KubernetesCloud.JNLP_NAME, this.image); | |
containerTemplate.setCommand(command); | |
containerTemplate.setArgs(Strings.isNullOrEmpty(args) ? FALLBACK_ARGUMENTS : args); | |
containerTemplate.setPrivileged(privileged); | |
containerTemplate.setAlwaysPullImage(alwaysPullImage); | |
containerTemplate.setEnvVars(envVars); | |
containerTemplate.setResourceRequestMemory(resourceRequestMemory); | |
containerTemplate.setResourceLimitCpu(resourceLimitCpu); | |
containerTemplate.setResourceLimitMemory(resourceLimitMemory); | |
containerTemplate.setResourceRequestCpu(resourceRequestCpu); | |
containerTemplate.setWorkingDir(remoteFs); | |
containers.add(containerTemplate); | |
} |
@adambkaplan did @gabemontero catch you up on this? |
Confirmed updating the deserialization path also works pushed a second comment with that in place and the prior fix commented out I'll squash / clean up / uncomment code as needed based on where the consensus lands after @carlossg chimes in. thanks |
bump @carlossg ... see #381 (comment) for latest status |
…njection (seen during agent termination)
Fixes https://issues.jenkins-ci.org/browse/JENKINS-53260
@carlossg ptal
@bparees @adambkaplan fyi