.withNewMetadata() .withGenerateName(config.getContainerIdPrefix()) .addToLabels(config.getLabels()) .endMetadata() .withNewSpec()
pods().inNamespace(namespace).withName(pod.getMetadata().getName()) .edit() .editMetadata().addToLabels(DEPLOYMENT_KEY, oldDeploymentHash) .and().done(); } catch (KubernetesClientException e) {
.withNewMetadata() .withName("testpod") .addToLabels("server", "nginx") .endMetadata() .withNewSpec() .addToLabels("server2", "nginx2") .and().done(); log("Replaced testPod:", updatedPod);
.withNewMetadata() .withName(podTemplate.getName()) .addToLabels(labels) .addToLabels("owner", "jenkins") .addToLabels("name", podTemplate.getName()) .addToLabels("image", containers.get(0).getName()) .endMetadata() .withNewSpec()
pods().inNamespace(namespace).withName(pod.getMetadata().getName()) .edit() .editMetadata().addToLabels(DEPLOYMENT_KEY, oldDeploymentHash) .and().done(); } catch (KubernetesClientException e) {
.addToLabels(OpenShiftService.INTEGRATION_ID_LABEL, "id")// .addToLabels(OpenShiftService.DEPLOYMENT_VERSION_LABEL, "1")//
@Override protected PodList listPods() { return new PodListBuilder() .addNewItem() .withNewMetadata() .withName("test-pod-x23x") .addToLabels(OpenShiftService.COMPONENT_LABEL, "integration") .addToLabels(OpenShiftService.DEPLOYMENT_VERSION_LABEL, "3") .addToLabels(OpenShiftService.INTEGRATION_ID_LABEL, "my-integration") .endMetadata() .withNewStatus() .withPhase("Running") .endStatus() .endItem().build(); }
@Override protected PodList listPods() { return new PodListBuilder() .addNewItem() .withNewMetadata() .withName("test-pod-x23x") .addToLabels(OpenShiftService.COMPONENT_LABEL, "integration") .addToAnnotations(OpenShiftService.DEPLOYMENT_VERSION_ANNOTATION, "3") .addToAnnotations(OpenShiftService.INTEGRATION_ID_ANNOTATION, "my-integration") .endMetadata() .withNewStatus() .withPhase("Running") .endStatus() .endItem().build(); }
@Override protected PodList listPods() { return new PodListBuilder() .addNewItem() .withNewMetadata() .withName("test-pod-x23x") .addToLabels(OpenShiftService.COMPONENT_LABEL, "integration") .addToLabels(OpenShiftService.DEPLOYMENT_ID_LABEL, "3") .addToAnnotations(OpenShiftService.INTEGRATION_ID_LABEL, "my-integration") .endMetadata() .withNewStatus() .withPhase("Running") .endStatus() .endItem().build(); }
private void launchPod(String appId, PodSpec podSpec, Map<String, String> labelMap, Map<String, String> idMap, Map<String, String> annotations) { client.pods() .createNew() .withNewMetadata() .withName(appId) .withLabels(labelMap) .withAnnotations(annotations) .addToLabels(idMap) .endMetadata() .withSpec(podSpec) .done(); }