From a1417ac9c63d40ffbbb5bffee46a55c36788c150 Mon Sep 17 00:00:00 2001 From: Angel Misevski Date: Fri, 21 Dec 2018 01:42:02 -0500 Subject: [PATCH] Simplify KubernetesEnvironment#addPod() slightly + cleanup Remove podName parameter from addPod method and simply get it from the pod's metadata. Additional cleanup and documentation changes: - Make some log messages level 'info' instead of 'debug' - Modify argument order in messages to to make more sense - Add docs for KubernetesEnvironment methods about how/when pods map can be modified - Fix issue where pods referencing nonexistent configmaps would emit unreadable error messages due to configmap renaming. - Clean up code according to PR Quality Review Signed-off-by: Angel Misevski --- .../kubernetes/KubernetesInternalRuntime.java | 10 +++++----- .../environment/KubernetesEnvironment.java | 12 +++++++++++- .../KubernetesEnvironmentValidator.java | 3 ++- .../provision/UniqueNamesProvisioner.java | 15 ++++++++++++--- .../secure/jwtproxy/JwtProxyProvisioner.java | 2 +- .../KubernetesPluginsToolingApplier.java | 2 +- .../KubernetesBrokerInitContainerApplierTest.java | 12 +++++------- .../KubernetesEnvironmentValidatorTest.java | 2 +- .../namespace/pvc/CommonPVCStrategyTest.java | 1 - .../provision/CertificateProvisionerTest.java | 11 ++++++----- .../provision/ImagePullSecretProvisionerTest.java | 6 +++++- .../ram/RamLimitRequestProvisionerTest.java | 2 -- .../KubernetesPluginsToolingApplierTest.java | 2 +- 13 files changed, 50 insertions(+), 30 deletions(-) diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntime.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntime.java index 869983bdcd..8a22a2156b 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntime.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesInternalRuntime.java @@ -718,9 +718,9 @@ public class KubernetesInternalRuntime final KubernetesEnvironment environment = getContext().getEnvironment(); final Map machineConfigs = environment.getMachines(); final String workspaceId = getContext().getIdentity().getWorkspaceId(); - LOG.debug("Begin pods creation for workspace '{}'", workspaceId); + LOG.info("Begin pods creation for workspace '{}'", workspaceId); for (Pod toCreate : environment.getPodsCopy().values()) { - startTracingContainersStartup(toCreate.getSpec(), toCreate.getMetadata()); + startTracingContainersStartup(toCreate.getMetadata(), toCreate.getSpec()); ObjectMeta toCreateMeta = toCreate.getMetadata(); final Pod createdPod = namespace.deployments().deploy(toCreate); LOG.debug("Creating pod '{}' in workspace '{}'", toCreateMeta.getName(), workspaceId); @@ -728,7 +728,7 @@ public class KubernetesInternalRuntime } for (Deployment toCreate : environment.getDeploymentsCopy().values()) { PodTemplateSpec template = toCreate.getSpec().getTemplate(); - startTracingContainersStartup(template.getSpec(), template.getMetadata()); + startTracingContainersStartup(template.getMetadata(), template.getSpec()); ObjectMeta toCreateMeta = toCreate.getMetadata(); final Pod createdPod = namespace.deployments().deploy(toCreate); LOG.debug("Creating deployment '{}' in workspace '{}'", toCreateMeta.getName(), workspaceId); @@ -737,7 +737,7 @@ public class KubernetesInternalRuntime final ObjectMeta templateMeta = toCreate.getSpec().getTemplate().getMetadata(); storeStartingMachine(createdPod, templateMeta, machineConfigs, serverResolver); } - LOG.debug("Pods creation finished in workspace '{}'", workspaceId); + LOG.info("Pods creation finished in workspace '{}'", workspaceId); } /** Puts createdPod in the {@code machines} map and sends the starting event for this machine */ @@ -766,7 +766,7 @@ public class KubernetesInternalRuntime } } - private void startTracingContainersStartup(PodSpec podSpec, ObjectMeta podMeta) { + private void startTracingContainersStartup(ObjectMeta podMeta, PodSpec podSpec) { if (tracer == null) { return; } diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironment.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironment.java index 795c3fc437..091e358daf 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironment.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironment.java @@ -165,6 +165,9 @@ public class KubernetesEnvironment extends InternalEnvironment { * *

Note: This map should not be changed, as it will only return pods and not * deployments. If objects in the map need to be changed, see {@link #getPodsData()} + * + *

If pods need to be added to the environment, then {@link #addPod(Pod)} should be used + * instead. */ public Map getPodsCopy() { return ImmutableMap.copyOf(pods); @@ -175,6 +178,9 @@ public class KubernetesEnvironment extends InternalEnvironment { * *

Note: This map should not be changed. If objects in the map need to be changed, see * {@link #getPodsData()} + * + *

If pods need to be added to the environment, then {@link #addPod(Pod)} should be used + * instead. */ public Map getDeploymentsCopy() { return ImmutableMap.copyOf(deployments); @@ -185,6 +191,9 @@ public class KubernetesEnvironment extends InternalEnvironment { * that should be created when environment starts. The data returned by this method represents all * deployment and pod objects that form the workspace, and should be used when provisioning or * performing any action that needs to see every object in the environment. + * + *

If pods need to be added to the environment, then {@link #addPod(Pod)} should be used + * instead. */ public Map getPodsData() { return ImmutableMap.copyOf(podData); @@ -194,7 +203,8 @@ public class KubernetesEnvironment extends InternalEnvironment { * Add a pod to the current environment. This method is necessary as the map returned by {@link * #getPodsCopy()} is a copy. This method also adds the relevant data to {@link #getPodsData()}. */ - public void addPod(String podName, Pod pod) { + public void addPod(Pod pod) { + String podName = pod.getMetadata().getName(); pods.put(podName, pod); podData.put(podName, new PodData(pod.getSpec(), pod.getMetadata())); } diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidator.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidator.java index ea4ba151fb..97c927dfb4 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidator.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidator.java @@ -35,7 +35,8 @@ public class KubernetesEnvironmentValidator { * @throws ValidationException if the specified {@link KubernetesEnvironment} is invalid */ public void validate(KubernetesEnvironment env) throws ValidationException { - checkArgument(!env.getPodsData().isEmpty(), "Environment should contain at least 1 pod"); + checkArgument( + !env.getPodsData().isEmpty(), "Environment should contain at least 1 pod or deployment"); Set missingMachines = new HashSet<>(env.getMachines().keySet()); for (PodData pod : env.getPodsData().values()) { diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/UniqueNamesProvisioner.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/UniqueNamesProvisioner.java index 7d2e915f62..ff3071b3fb 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/UniqueNamesProvisioner.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/UniqueNamesProvisioner.java @@ -117,7 +117,12 @@ public class UniqueNamesProvisioner env -> { ConfigMapKeySelector configMap = env.getValueFrom().getConfigMapKeyRef(); String originalName = configMap.getName(); - configMap.setName(configMapNameTranslation.get(originalName)); + // Since pods can reference configmaps that don't exist, we only change the name + // if the configmap does exist to aid debugging recipes (otherwise message is just + // null). + if (configMapNameTranslation.containsKey(originalName)) { + configMap.setName(configMapNameTranslation.get(originalName)); + } }); } if (container.getEnvFrom() != null) { @@ -130,7 +135,9 @@ public class UniqueNamesProvisioner envFrom -> { ConfigMapEnvSource configMapRef = envFrom.getConfigMapRef(); String originalName = configMapRef.getName(); - configMapRef.setName(configMapNameTranslation.get(originalName)); + if (configMapNameTranslation.containsKey(originalName)) { + configMapRef.setName(configMapNameTranslation.get(originalName)); + } }); } } @@ -144,7 +151,9 @@ public class UniqueNamesProvisioner volume -> { ConfigMapVolumeSource configMapVolume = volume.getConfigMap(); String originalName = configMapVolume.getName(); - configMapVolume.setName(configMapNameTranslation.get(originalName)); + if (configMapNameTranslation.containsKey(originalName)) { + configMapVolume.setName(configMapNameTranslation.get(originalName)); + } }); } } diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/secure/jwtproxy/JwtProxyProvisioner.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/secure/jwtproxy/JwtProxyProvisioner.java index fa44478c44..95040dcb2e 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/secure/jwtproxy/JwtProxyProvisioner.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/server/secure/jwtproxy/JwtProxyProvisioner.java @@ -213,7 +213,7 @@ public class JwtProxyProvisioner { private void ensureJwtProxyInjected(KubernetesEnvironment k8sEnv) throws InfrastructureException { if (!k8sEnv.getMachines().containsKey(JWT_PROXY_MACHINE_NAME)) { k8sEnv.getMachines().put(JWT_PROXY_MACHINE_NAME, createJwtProxyMachine()); - k8sEnv.addPod(JWT_PROXY_POD_NAME, createJwtProxyPod()); + k8sEnv.addPod(createJwtProxyPod()); KeyPair keyPair; try { diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplier.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplier.java index fe1a4970eb..0f045db2f3 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplier.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplier.java @@ -127,7 +127,7 @@ public class KubernetesPluginsToolingApplier implements ChePluginsApplier { .endSpec() .build(); - kubernetesEnvironment.addPod(CHE_WORKSPACE_POD, pod); + kubernetesEnvironment.addPod(pod); } private void populateWorkspaceEnvVars( diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesBrokerInitContainerApplierTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesBrokerInitContainerApplierTest.java index 09d445ddb9..d7c35ca7e2 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesBrokerInitContainerApplierTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/KubernetesBrokerInitContainerApplierTest.java @@ -15,6 +15,7 @@ import static org.eclipse.che.workspace.infrastructure.kubernetes.Constants.MACH import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; @@ -80,14 +81,11 @@ public class KubernetesBrokerInitContainerApplierTest { @Mock private InternalMachineConfig brokerMachine; private Volume brokerVolume; private ConfigMap brokerConfigMap; - private KubernetesEnvironment brokerEnvironment; - private Pod brokerPod; private Container brokerContainer; // Workspace Environment mocks private KubernetesEnvironment workspaceEnvironment; private Pod workspacePod; - private Map workspaceConfigMaps; private KubernetesBrokerInitContainerApplier applier; @@ -97,7 +95,7 @@ public class KubernetesBrokerInitContainerApplierTest { ObjectMeta workspacePodMeta = new ObjectMetaBuilder().withAnnotations(workspacePodAnnotations).build(); workspacePod = new PodBuilder().withMetadata(workspacePodMeta).withSpec(new PodSpec()).build(); - workspaceConfigMaps = new HashMap<>(); + Map workspaceConfigMaps = new HashMap<>(); workspaceEnvironment = KubernetesEnvironment.builder() .setPods(ImmutableMap.of(WORKSPACE_POD_NAME, workspacePod)) @@ -110,7 +108,7 @@ public class KubernetesBrokerInitContainerApplierTest { new ObjectMetaBuilder().withAnnotations(brokerPodAnnotations).build(); brokerContainer = new ContainerBuilder().withName(BROKER_CONTAINER_NAME).build(); brokerVolume = new VolumeBuilder().build(); - brokerPod = + Pod brokerPod = new PodBuilder() .withMetadata(brokerPodMeta) .withNewSpec() @@ -119,7 +117,7 @@ public class KubernetesBrokerInitContainerApplierTest { .endSpec() .build(); brokerConfigMap = new ConfigMapBuilder().addToData(brokerConfigMapData).build(); - brokerEnvironment = + KubernetesEnvironment brokerEnvironment = KubernetesEnvironment.builder() .setPods(ImmutableMap.of(BROKER_POD_NAME, brokerPod)) .setConfigMaps(ImmutableMap.of(BROKER_CONFIGMAP_NAME, brokerConfigMap)) @@ -144,7 +142,7 @@ public class KubernetesBrokerInitContainerApplierTest { ConfigMap workspaceConfigMap = workspaceEnvironment.getConfigMaps().get(BROKER_CONFIGMAP_NAME); assertNotNull(workspaceConfigMap); - assertTrue(!workspaceConfigMap.getData().isEmpty()); + assertFalse(workspaceConfigMap.getData().isEmpty()); assertTrue( workspaceConfigMap .getData() diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidatorTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidatorTest.java index 44c842398c..dac31590d4 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidatorTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/environment/KubernetesEnvironmentValidatorTest.java @@ -49,7 +49,7 @@ public class KubernetesEnvironmentValidatorTest { @Test( expectedExceptions = ValidationException.class, - expectedExceptionsMessageRegExp = "Environment should contain at least 1 pod") + expectedExceptionsMessageRegExp = "Environment should contain at least 1 pod or deployment") public void shouldThrowExceptionWhenEnvDoesNotHaveAnyPods() throws Exception { // given when(kubernetesEnvironment.getPodsData()).thenReturn(emptyMap()); diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/pvc/CommonPVCStrategyTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/pvc/CommonPVCStrategyTest.java index 9b369d4b0f..45ac270a42 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/pvc/CommonPVCStrategyTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/pvc/CommonPVCStrategyTest.java @@ -161,7 +161,6 @@ public class CommonPVCStrategyTest { mockName(pod, POD_NAME); mockName(pod2, POD_NAME_2); - Map pods = ImmutableMap.of(POD_NAME, pod, POD_NAME_2, pod); Map podData = ImmutableMap.of( POD_NAME, new PodData(pod.getSpec(), pod.getMetadata()), diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/CertificateProvisionerTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/CertificateProvisionerTest.java index a82571e919..e33190f10c 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/CertificateProvisionerTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/CertificateProvisionerTest.java @@ -107,8 +107,8 @@ public class CertificateProvisionerTest { @Test public void shouldAddVolumeAndVolumeMountsToPodsAndContainersInEnvironment() throws Exception { // given - k8sEnv.addPod("pod", createPod()); - k8sEnv.addPod("pod2", createPod()); + k8sEnv.addPod(createPod("pod")); + k8sEnv.addPod(createPod("pod2")); // when provisioner.provision(k8sEnv, runtimeId); @@ -128,8 +128,8 @@ public class CertificateProvisionerTest { throws Exception { // given provisioner = new CertificateProvisioner(""); - k8sEnv.addPod("pod", createPod()); - k8sEnv.addPod("pod2", createPod()); + k8sEnv.addPod(createPod("pod")); + k8sEnv.addPod(createPod("pod2")); // when provisioner.provision(k8sEnv, runtimeId); @@ -162,9 +162,10 @@ public class CertificateProvisionerTest { assertEquals(volumeMount.getMountPath(), CERT_MOUNT_PATH); } - private Pod createPod() { + private Pod createPod(String podName) { return new PodBuilder() .withNewMetadata() + .withName(podName) .endMetadata() .withNewSpec() .withContainers(new ContainerBuilder().build(), new ContainerBuilder().build()) diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/ImagePullSecretProvisionerTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/ImagePullSecretProvisionerTest.java index 22656ac28c..dadbfdfd62 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/ImagePullSecretProvisionerTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/ImagePullSecretProvisionerTest.java @@ -24,6 +24,8 @@ import com.google.common.collect.ImmutableMap; import com.google.gson.Gson; import io.fabric8.kubernetes.api.model.LocalObjectReference; import io.fabric8.kubernetes.api.model.LocalObjectReferenceBuilder; +import io.fabric8.kubernetes.api.model.ObjectMeta; +import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodSpec; import io.fabric8.kubernetes.api.model.Secret; @@ -75,9 +77,11 @@ public class ImagePullSecretProvisionerTest { when(runtimeIdentity.getWorkspaceId()).thenReturn(WORKSPACE_ID); k8sEnv = KubernetesEnvironment.builder().build(); + ObjectMeta podMeta = new ObjectMetaBuilder().withName("wksp").build(); + when(pod.getMetadata()).thenReturn(podMeta); when(pod.getSpec()).thenReturn(podSpec); when(podSpec.getImagePullSecrets()).thenReturn(ImmutableList.of(existingImagePullSecretRef)); - k8sEnv.addPod("wksp", pod); + k8sEnv.addPod(pod); when(credentialsProvider.getCredentials()).thenReturn(authConfigs); imagePullSecretProvisioner = new ImagePullSecretProvisioner(credentialsProvider); diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/limits/ram/RamLimitRequestProvisionerTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/limits/ram/RamLimitRequestProvisionerTest.java index 295d8df07f..8eaf82fdb3 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/limits/ram/RamLimitRequestProvisionerTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/limits/ram/RamLimitRequestProvisionerTest.java @@ -20,7 +20,6 @@ import static org.testng.Assert.assertEquals; import io.fabric8.kubernetes.api.model.Container; import io.fabric8.kubernetes.api.model.ObjectMeta; -import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodSpec; import io.fabric8.kubernetes.api.model.Quantity; import io.fabric8.kubernetes.api.model.ResourceRequirements; @@ -55,7 +54,6 @@ public class RamLimitRequestProvisionerTest { @Mock private KubernetesEnvironment k8sEnv; @Mock private RuntimeIdentity identity; - @Mock private Pod pod; @Mock private InternalMachineConfig internalMachineConfig; @Mock private MemoryAttributeProvisioner memoryAttributeProvisioner; diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplierTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplierTest.java index cad4500b8f..ad77cb0208 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplierTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/KubernetesPluginsToolingApplierTest.java @@ -111,7 +111,7 @@ public class KubernetesPluginsToolingApplierTest { lenient().when(podSpec.getContainers()).thenReturn(containers); lenient().when(pod.getMetadata()).thenReturn(meta); lenient().when(meta.getName()).thenReturn(POD_NAME); - internalEnvironment.addPod(POD_NAME, pod); + internalEnvironment.addPod(pod); internalEnvironment.getMachines().putAll(machines); }