2018-08-21 15:45:59 +02:00
|
|
|
import com.sap.piper.JenkinsUtils
|
2018-08-31 10:22:43 +02:00
|
|
|
|
2018-08-21 15:45:59 +02:00
|
|
|
import org.junit.Before
|
|
|
|
import org.junit.Rule
|
|
|
|
import org.junit.Test
|
|
|
|
import org.junit.rules.ExpectedException
|
|
|
|
import org.junit.rules.RuleChain
|
|
|
|
|
2018-08-31 10:22:43 +02:00
|
|
|
|
2019-03-20 11:07:37 +02:00
|
|
|
import groovy.json.JsonSlurper
|
2018-08-21 15:45:59 +02:00
|
|
|
import util.BasePiperTest
|
|
|
|
import util.JenkinsDockerExecuteRule
|
|
|
|
import util.JenkinsLoggingRule
|
2018-08-31 10:22:43 +02:00
|
|
|
import util.JenkinsReadYamlRule
|
2018-08-21 15:45:59 +02:00
|
|
|
import util.JenkinsShellCallRule
|
|
|
|
import util.JenkinsStepRule
|
|
|
|
import util.PluginMock
|
|
|
|
import util.Rules
|
|
|
|
|
2018-10-04 17:06:42 +02:00
|
|
|
import static org.hamcrest.Matchers.*
|
|
|
|
import static org.junit.Assert.assertThat
|
2018-08-21 15:45:59 +02:00
|
|
|
import static org.junit.Assert.assertTrue
|
|
|
|
import static org.junit.Assert.assertEquals
|
|
|
|
import static org.junit.Assert.assertFalse
|
|
|
|
|
|
|
|
class DockerExecuteOnKubernetesTest extends BasePiperTest {
|
|
|
|
private ExpectedException exception = ExpectedException.none()
|
2019-01-22 10:26:08 +02:00
|
|
|
private JenkinsDockerExecuteRule dockerExecuteRule = new JenkinsDockerExecuteRule(this)
|
2019-01-22 10:19:28 +02:00
|
|
|
private JenkinsShellCallRule shellRule = new JenkinsShellCallRule(this)
|
2019-01-22 10:22:15 +02:00
|
|
|
private JenkinsLoggingRule loggingRule = new JenkinsLoggingRule(this)
|
2019-01-22 10:25:42 +02:00
|
|
|
private JenkinsStepRule stepRule = new JenkinsStepRule(this)
|
2018-08-21 15:45:59 +02:00
|
|
|
|
|
|
|
@Rule
|
|
|
|
public RuleChain ruleChain = Rules
|
|
|
|
.getCommonRules(this)
|
2018-08-31 10:22:43 +02:00
|
|
|
.around(new JenkinsReadYamlRule(this))
|
2018-08-21 15:45:59 +02:00
|
|
|
.around(exception)
|
2019-01-22 10:26:08 +02:00
|
|
|
.around(dockerExecuteRule)
|
2019-01-22 10:19:28 +02:00
|
|
|
.around(shellRule)
|
2019-01-22 10:22:15 +02:00
|
|
|
.around(loggingRule)
|
2019-01-22 10:25:42 +02:00
|
|
|
.around(stepRule)
|
2018-08-21 15:45:59 +02:00
|
|
|
int whichDockerReturnValue = 0
|
|
|
|
def bodyExecuted
|
|
|
|
def dockerImage
|
|
|
|
def containerMap
|
|
|
|
def dockerEnvVars
|
|
|
|
def dockerWorkspace
|
|
|
|
def podName = ''
|
|
|
|
def podLabel = ''
|
2019-06-19 12:26:16 +02:00
|
|
|
def podNodeSelector = ''
|
2018-08-21 15:45:59 +02:00
|
|
|
def containersList = []
|
|
|
|
def imageList = []
|
|
|
|
def containerName = ''
|
2019-01-08 20:44:28 +02:00
|
|
|
def containerShell = ''
|
2018-08-21 15:45:59 +02:00
|
|
|
def envList = []
|
2018-10-04 17:06:42 +02:00
|
|
|
def portList = []
|
|
|
|
def containerCommands = []
|
2019-02-06 09:48:33 +02:00
|
|
|
def pullImageMap = [:]
|
2019-03-20 11:07:37 +02:00
|
|
|
def namespace
|
|
|
|
def securityContext
|
2019-06-05 14:00:04 +02:00
|
|
|
Map stashMap
|
2018-08-21 15:45:59 +02:00
|
|
|
|
|
|
|
@Before
|
|
|
|
void init() {
|
|
|
|
containersList = []
|
|
|
|
imageList = []
|
|
|
|
envList = []
|
2018-10-04 17:06:42 +02:00
|
|
|
portList = []
|
|
|
|
containerCommands = []
|
2018-08-21 15:45:59 +02:00
|
|
|
bodyExecuted = false
|
|
|
|
JenkinsUtils.metaClass.static.isPluginActive = { def s -> new PluginMock(s).isActive() }
|
|
|
|
helper.registerAllowedMethod('sh', [Map.class], {return whichDockerReturnValue})
|
|
|
|
helper.registerAllowedMethod('container', [Map.class, Closure.class], { Map config, Closure body -> container(config){body()}
|
|
|
|
})
|
|
|
|
helper.registerAllowedMethod('podTemplate', [Map.class, Closure.class], { Map options, Closure body ->
|
|
|
|
podName = options.name
|
|
|
|
podLabel = options.label
|
2019-03-20 11:07:37 +02:00
|
|
|
namespace = options.namespace
|
2019-06-19 12:26:16 +02:00
|
|
|
podNodeSelector = options.nodeSelector
|
2019-03-20 11:07:37 +02:00
|
|
|
def podSpec = new JsonSlurper().parseText(options.yaml) // this yaml is actually json
|
|
|
|
def containers = podSpec.spec.containers
|
|
|
|
securityContext = podSpec.spec.securityContext
|
|
|
|
|
|
|
|
containers.each { container ->
|
|
|
|
containersList.add(container.name)
|
|
|
|
imageList.add(container.image.toString())
|
|
|
|
envList.add(container.env)
|
|
|
|
if(container.ports) {
|
|
|
|
portList.add(container.ports)
|
|
|
|
}
|
|
|
|
if (container.command) {
|
|
|
|
containerCommands.add(container.command)
|
2018-10-04 17:06:42 +02:00
|
|
|
}
|
2019-03-20 11:07:37 +02:00
|
|
|
pullImageMap.put(container.image.toString(), container.imagePullPolicy == "Always")
|
2018-08-21 15:45:59 +02:00
|
|
|
}
|
|
|
|
body()
|
|
|
|
})
|
2019-06-05 14:00:04 +02:00
|
|
|
helper.registerAllowedMethod('stash', [Map.class], {m ->
|
|
|
|
stashMap = m
|
|
|
|
})
|
|
|
|
|
2018-08-21 15:45:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testRunOnPodNoContainerMapOnlyDockerImage() throws Exception {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
2018-11-05 12:24:25 +02:00
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
2018-08-21 15:45:59 +02:00
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine',
|
|
|
|
dockerOptions: '-it',
|
|
|
|
dockerVolumeBind: ['my_vol': '/my_vol'],
|
2018-10-08 11:54:13 +02:00
|
|
|
dockerEnvVars: ['http_proxy': 'http://proxy:8000'], dockerWorkspace: '/home/piper'
|
|
|
|
){
|
|
|
|
bodyExecuted = true
|
2018-08-21 15:45:59 +02:00
|
|
|
}
|
2018-10-08 11:54:13 +02:00
|
|
|
assertThat(containersList, hasItem('container-exec'))
|
|
|
|
assertThat(imageList, hasItem('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertThat(envList.toString(), containsString('http_proxy'))
|
|
|
|
assertThat(envList.toString(), containsString('http://proxy:8000'))
|
|
|
|
assertThat(envList.toString(), containsString('/home/piper'))
|
|
|
|
assertThat(bodyExecuted, is(true))
|
2018-10-04 17:06:42 +02:00
|
|
|
assertThat(containerCommands.size(), is(1))
|
2018-08-21 15:45:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomContainerMap() throws Exception {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(script: nullScript,
|
2018-08-21 15:45:59 +02:00
|
|
|
containerMap: ['maven:3.5-jdk-8-alpine': 'mavenexecute']) {
|
|
|
|
container(name: 'mavenexecute') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertEquals('mavenexecute', containerName)
|
|
|
|
assertTrue(containersList.contains('mavenexecute'))
|
|
|
|
assertTrue(imageList.contains('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertTrue(bodyExecuted)
|
2018-10-04 17:06:42 +02:00
|
|
|
assertThat(containerCommands.size(), is(1))
|
2018-08-21 15:45:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomJnlpWithContainerMap() throws Exception {
|
|
|
|
nullScript.commonPipelineEnvironment.configuration = ['general': ['jenkinsKubernetes': ['jnlpAgent': 'myJnalpAgent']]]
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(script: nullScript,
|
2018-08-21 15:45:59 +02:00
|
|
|
containerMap: ['maven:3.5-jdk-8-alpine': 'mavenexecute']) {
|
|
|
|
container(name: 'mavenexecute') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertEquals('mavenexecute', containerName)
|
|
|
|
assertTrue(containersList.contains('mavenexecute'))
|
|
|
|
assertTrue(imageList.contains('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertTrue(containersList.contains('jnlp'))
|
|
|
|
assertTrue(imageList.contains('myJnalpAgent'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomJnlpWithDockerImage() throws Exception {
|
|
|
|
nullScript.commonPipelineEnvironment.configuration = ['general': ['jenkinsKubernetes': ['jnlpAgent': 'myJnalpAgent']]]
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
2018-11-05 12:24:25 +02:00
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
2018-08-21 15:45:59 +02:00
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
assertEquals('container-exec', containerName)
|
|
|
|
assertTrue(containersList.contains('jnlp'))
|
|
|
|
assertTrue(containersList.contains('container-exec'))
|
|
|
|
assertTrue(imageList.contains('myJnalpAgent'))
|
|
|
|
assertTrue(imageList.contains('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomWorkspace() throws Exception {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(script: nullScript,
|
2018-08-21 15:45:59 +02:00
|
|
|
containerMap: ['maven:3.5-jdk-8-alpine': 'mavenexecute'],
|
|
|
|
dockerWorkspace: '/home/piper') {
|
|
|
|
container(name: 'mavenexecute') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertTrue(envList.toString().contains('/home/piper'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomEnv() throws Exception {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(script: nullScript,
|
2018-08-21 15:45:59 +02:00
|
|
|
containerMap: ['maven:3.5-jdk-8-alpine': 'mavenexecute'],
|
|
|
|
dockerEnvVars: ['customEnvKey': 'customEnvValue']) {
|
|
|
|
container(name: 'mavenexecute') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertTrue(envList.toString().contains('customEnvKey') && envList.toString().contains('customEnvValue'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesUpperCaseContainerName() throws Exception {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(script: nullScript,
|
2018-08-21 15:45:59 +02:00
|
|
|
containerMap: ['maven:3.5-jdk-8-alpine': 'MAVENEXECUTE'],
|
|
|
|
dockerEnvVars: ['customEnvKey': 'customEnvValue']) {
|
|
|
|
container(name: 'mavenexecute') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertEquals('mavenexecute', containerName)
|
|
|
|
assertTrue(containersList.contains('mavenexecute'))
|
|
|
|
assertTrue(imageList.contains('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesEmptyContainerMapNoDockerImage() throws Exception {
|
2019-05-22 16:56:50 +02:00
|
|
|
exception.expect(IllegalArgumentException.class)
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
2018-11-05 12:24:25 +02:00
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
2018-08-21 15:45:59 +02:00
|
|
|
containerMap: [:],
|
|
|
|
dockerEnvVars: ['customEnvKey': 'customEnvValue']) {
|
|
|
|
container(name: 'jnlp') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertFalse(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
2018-10-04 17:06:42 +02:00
|
|
|
@Test
|
|
|
|
void testSidecarDefault() {
|
|
|
|
List portMapping = []
|
|
|
|
helper.registerAllowedMethod('portMapping', [Map.class], {m ->
|
|
|
|
portMapping.add(m)
|
|
|
|
return m
|
|
|
|
})
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
2018-10-04 17:06:42 +02:00
|
|
|
script: nullScript,
|
2018-11-05 12:24:25 +02:00
|
|
|
juStabUtils: utils,
|
2018-10-04 17:06:42 +02:00
|
|
|
containerCommands: ['selenium/standalone-chrome': ''],
|
|
|
|
containerEnvVars: [
|
|
|
|
'selenium/standalone-chrome': ['customEnvKey': 'customEnvValue']
|
|
|
|
],
|
|
|
|
containerMap: [
|
|
|
|
'maven:3.5-jdk-8-alpine': 'mavenexecute',
|
|
|
|
'selenium/standalone-chrome': 'selenium'
|
|
|
|
],
|
|
|
|
containerName: 'mavenexecute',
|
|
|
|
containerPortMappings: [
|
2019-04-02 14:23:19 +02:00
|
|
|
'selenium/standalone-chrome': [[containerPort: 4444]]
|
2018-10-04 17:06:42 +02:00
|
|
|
],
|
|
|
|
containerWorkspaces: [
|
|
|
|
'selenium/standalone-chrome': ''
|
|
|
|
],
|
|
|
|
dockerWorkspace: '/home/piper'
|
|
|
|
) {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
|
|
|
|
assertThat(bodyExecuted, is(true))
|
|
|
|
assertThat(containerName, is('mavenexecute'))
|
|
|
|
|
|
|
|
assertThat(containersList, allOf(
|
|
|
|
hasItem('jnlp'),
|
|
|
|
hasItem('mavenexecute'),
|
|
|
|
hasItem('selenium'),
|
|
|
|
))
|
|
|
|
assertThat(imageList, allOf(
|
|
|
|
hasItem('s4sdk/jenkins-agent-k8s:latest'),
|
|
|
|
hasItem('maven:3.5-jdk-8-alpine'),
|
|
|
|
hasItem('selenium/standalone-chrome'),
|
|
|
|
))
|
2019-04-02 14:23:19 +02:00
|
|
|
assertThat(portList, hasItem([[name: 'selenium0', containerPort: 4444]]))
|
2018-10-04 17:06:42 +02:00
|
|
|
assertThat(containerCommands.size(), is(1))
|
2019-03-20 11:07:37 +02:00
|
|
|
assertThat(envList, hasItem(hasItem(allOf(hasEntry('name', 'customEnvKey'), hasEntry ('value','customEnvValue')))))
|
2018-10-04 17:06:42 +02:00
|
|
|
}
|
|
|
|
|
2019-01-08 20:44:28 +02:00
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomShell() {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
2019-01-08 20:44:28 +02:00
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine',
|
|
|
|
containerShell: '/busybox/sh'
|
|
|
|
) {
|
|
|
|
//nothing to exeute
|
|
|
|
}
|
|
|
|
assertThat(containerShell, is('/busybox/sh'))
|
|
|
|
}
|
|
|
|
|
2019-01-14 15:43:07 +02:00
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomContainerCommand() {
|
2019-01-22 10:25:42 +02:00
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
2019-01-14 15:43:07 +02:00
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine',
|
|
|
|
containerCommand: '/busybox/tail -f /dev/null'
|
|
|
|
) {
|
|
|
|
//nothing to exeute
|
|
|
|
}
|
2019-03-20 11:07:37 +02:00
|
|
|
assertThat(containerCommands, hasItem(['/bin/sh', '-c', '/busybox/tail -f /dev/null']))
|
2019-01-14 15:43:07 +02:00
|
|
|
}
|
|
|
|
|
2019-02-06 09:48:33 +02:00
|
|
|
@Test
|
|
|
|
void testSkipDockerImagePull() throws Exception {
|
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
|
|
|
script: nullScript,
|
|
|
|
dockerPullImage: false,
|
|
|
|
containerMap: ['maven:3.5-jdk-8-alpine': 'mavenexecute']
|
|
|
|
) {
|
|
|
|
container(name: 'mavenexecute') {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assertEquals(false, pullImageMap.get('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testSkipSidecarImagePull() throws Exception {
|
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
|
|
|
containerCommands: ['selenium/standalone-chrome': ''],
|
|
|
|
containerEnvVars: [
|
|
|
|
'selenium/standalone-chrome': ['customEnvKey': 'customEnvValue']
|
|
|
|
],
|
|
|
|
containerMap: [
|
|
|
|
'maven:3.5-jdk-8-alpine': 'mavenexecute',
|
|
|
|
'selenium/standalone-chrome': 'selenium'
|
|
|
|
],
|
|
|
|
containerName: 'mavenexecute',
|
|
|
|
containerWorkspaces: [
|
|
|
|
'selenium/standalone-chrome': ''
|
|
|
|
],
|
|
|
|
containerPullImageFlags: [
|
|
|
|
'maven:3.5-jdk-8-alpine': true,
|
|
|
|
'selenium/standalone-chrome': false
|
|
|
|
],
|
|
|
|
dockerWorkspace: '/home/piper'
|
|
|
|
) {
|
|
|
|
bodyExecuted = true
|
|
|
|
}
|
|
|
|
assertEquals(true, pullImageMap.get('maven:3.5-jdk-8-alpine'))
|
|
|
|
assertEquals(false, pullImageMap.get('selenium/standalone-chrome'))
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
}
|
2018-10-04 17:06:42 +02:00
|
|
|
|
2019-03-20 11:07:37 +02:00
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithCustomNamespace() {
|
|
|
|
def expectedNamespace = "sandbox"
|
|
|
|
nullScript.commonPipelineEnvironment.configuration = [general: [jenkinsKubernetes: [namespace: expectedNamespace]]]
|
|
|
|
|
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine',
|
|
|
|
) { bodyExecuted = true }
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
assertThat(namespace, is(equalTo(expectedNamespace)))
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testDockerExecuteOnKubernetesWithSecurityContext() {
|
|
|
|
def expectedSecurityContext = [ runAsUser: 1000, fsGroup: 1000 ]
|
|
|
|
nullScript.commonPipelineEnvironment.configuration = [general: [jenkinsKubernetes: [
|
|
|
|
securityContext: expectedSecurityContext]]]
|
|
|
|
|
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine',
|
|
|
|
) { bodyExecuted = true }
|
|
|
|
assertTrue(bodyExecuted)
|
|
|
|
assertThat(securityContext, is(equalTo(expectedSecurityContext)))
|
|
|
|
}
|
|
|
|
|
2019-06-05 11:24:32 +02:00
|
|
|
@Test
|
2019-06-19 12:26:16 +02:00
|
|
|
void testDockerExecuteOnKubernetesCustomNode() {
|
2019-06-05 11:24:32 +02:00
|
|
|
|
|
|
|
stepRule.step.dockerExecuteOnKubernetes(
|
|
|
|
script: nullScript,
|
|
|
|
juStabUtils: utils,
|
|
|
|
dockerImage: 'maven:3.5-jdk-8-alpine',
|
2019-06-19 12:26:16 +02:00
|
|
|
nodeSelector: 'size:big'
|
2019-06-05 11:24:32 +02:00
|
|
|
) { bodyExecuted = true }
|
|
|
|
assertTrue(bodyExecuted)
|
2019-06-19 12:26:16 +02:00
|
|
|
assertThat(podNodeSelector, is('size:big'))
|
2019-06-05 11:24:32 +02:00
|
|
|
}
|
|
|
|
|
2019-03-20 11:07:37 +02:00
|
|
|
|
2018-08-21 15:45:59 +02:00
|
|
|
private container(options, body) {
|
|
|
|
containerName = options.name
|
2019-01-08 20:44:28 +02:00
|
|
|
containerShell = options.shell
|
2018-08-21 15:45:59 +02:00
|
|
|
body()
|
|
|
|
}
|
|
|
|
}
|