Search in sources :

Example 1 with Never

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" + "}");
}
Also used : DynamicPVCWorkspaceVolume(org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.DynamicPVCWorkspaceVolume) Merge(org.csanchez.jenkins.plugins.kubernetes.pod.yaml.Merge) Never(org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never) Test(org.junit.Test)

Example 2 with Never

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());
}
Also used : Never(org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never) Default(org.csanchez.jenkins.plugins.kubernetes.pod.retention.Default) LocalData(org.jvnet.hudson.test.recipes.LocalData) Test(org.junit.Test)

Aggregations

Never (org.csanchez.jenkins.plugins.kubernetes.pod.retention.Never)2 Test (org.junit.Test)2 Default (org.csanchez.jenkins.plugins.kubernetes.pod.retention.Default)1 Merge (org.csanchez.jenkins.plugins.kubernetes.pod.yaml.Merge)1 DynamicPVCWorkspaceVolume (org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.DynamicPVCWorkspaceVolume)1 LocalData (org.jvnet.hudson.test.recipes.LocalData)1