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-66986] Allow non kubernetes nodes to be provisioned inside the container clause #1087

Merged
merged 9 commits into from Dec 10, 2021

Conversation

presPetkov
Copy link
Contributor

@presPetkov presPetkov commented Dec 8, 2021

  • 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 demonstrates feature works or fixes the issue

Description:
When a non Kubernetes node is provisioned inside the container clause the steps executions fail because it is trying to cast a DumbSlave to KubernetesSlave - https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecDecorator.java#L255. I added a check and if the node is not an instance of KubernetesSlave it just returns the original launcher.

JIRA Link: https://issues.jenkins.io/browse/JENKINS-66986

No upstream or downstream changes.

Before change

image

image

image

image

After change

image

image

image

@presPetkov presPetkov closed this Dec 8, 2021
@presPetkov presPetkov reopened this Dec 9, 2021
@presPetkov presPetkov marked this pull request as ready for review December 9, 2021 15:15
Copy link
Member

@Vlatombe Vlatombe left a comment

Choose a reason for hiding this comment

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

Looks good overall. Can be simplified though.

presPetkov and others added 3 commits December 10, 2021 10:06
…/ContainerExecDecoratorTest.java

Co-authored-by: Vincent Latombe <vincent@latombe.net>
…/ContainerExecDecorator.java

Co-authored-by: Vincent Latombe <vincent@latombe.net>
…/ContainerExecDecoratorTest.java

Co-authored-by: Vincent Latombe <vincent@latombe.net>
@Vlatombe Vlatombe changed the title Allow non kubernetes nodes to be provisioned inside the container clause [JENKINS-66986] Allow non kubernetes nodes to be provisioned inside the container clause Dec 10, 2021
@Vlatombe Vlatombe added the bug Bug Fixes label Dec 10, 2021
@presPetkov presPetkov marked this pull request as draft December 10, 2021 12:58
@presPetkov
Copy link
Contributor Author

Test after changes

image

image

image

@presPetkov presPetkov marked this pull request as ready for review December 10, 2021 14:13
@Vlatombe Vlatombe merged commit 365dd06 into jenkinsci:master Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug Fixes
Projects
None yet
2 participants