use of org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never in project kubernetes-plugin by jenkinsci.
the class KubernetesDeclarativeAgentUnitTest method complexGenerator.
@Test
public void complexGenerator() throws Exception {
instance.setCloud("cloud");
instance.setYaml("yaml");
instance.setYamlMergeStrategy(new Merge());
DynamicPVCWorkspaceVolume workspaceVolume = new DynamicPVCWorkspaceVolume();
workspaceVolume.setStorageClassName("sc");
workspaceVolume.setRequestsSize("1G");
workspaceVolume.setAccessModes("ReadWrite");
instance.setWorkspaceVolume(workspaceVolume);
instance.setPodRetention(new Never());
instance.setInheritFrom("inheritFrom");
dg.assertGenerateDirective(directive, "agent {\n" + " kubernetes {\n" + " cloud 'cloud'\n" + " inheritFrom 'inheritFrom'\n" + " podRetention never()\n" + " workspaceVolume dynamicPVC(accessModes: 'ReadWrite', requestsSize: '1G', storageClassName: 'sc')\n" + " yaml 'yaml'\n" + " yamlMergeStrategy merge()\n" + " }\n" + "}");
}
use of org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never in project kubernetes-plugin by jenkinsci.
the class KubernetesTest method upgradeFrom_1_10.
@Test
@LocalData()
public void upgradeFrom_1_10() throws Exception {
List<PodTemplate> templates = cloud.getTemplates();
assertPodTemplates(templates);
assertEquals(new Never(), cloud.getPodRetention());
PodTemplate template = templates.get(0);
assertEquals(new Default(), template.getPodRetention());
assertEquals(cloud.DEFAULT_WAIT_FOR_POD_SEC, cloud.getWaitForPodSec());
assertTrue(template.isShowRawYaml());
assertEquals(Collections.emptyList(), template.getYamls());
assertNull(template.getYaml());
}
Aggregations