KubernetesInternalRuntime extends InternalRuntime<KubernetesRuntimeContext<E>> { @Traced protected List<ConfigMap> createConfigMaps(KubernetesEnvironment env, RuntimeIdentity identity) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(identity.getWorkspaceId()); List<ConfigMap> createdConfigMaps = new ArrayList<>(); List<ConfigMap> cheNamespaceConfigMaps = new ArrayList<>(); for (ConfigMap configMap : env.getConfigMaps().values()) { if (shouldCreateInCheNamespace(configMap)) { cheNamespaceConfigMaps.add(configMap); } else { createdConfigMaps.add(namespace.configMaps().create(configMap)); } } createdConfigMaps.addAll(cheNamespace.createConfigMaps(cheNamespaceConfigMaps, identity)); return createdConfigMaps; } @Inject  KubernetesInternalRuntime(
      @Named("che.infra.kubernetes.workspace_start_timeout_min") int workspaceStartTimeoutMin,
      @Named("che.infra.kubernetes.ingress_start_timeout_min") int ingressStartTimeoutMin,
      NoOpURLRewriter urlRewriter,
      UnrecoverablePodEventListenerFactory unrecoverableEventListenerFactory,
      ServersCheckerFactory serverCheckerFactory,
      WorkspaceVolumesStrategy volumesStrategy,
      ProbeScheduler probeScheduler,
      WorkspaceProbesFactory probesFactory,
      RuntimeEventsPublisher eventPublisher,
      KubernetesSharedPool sharedPool,
      KubernetesRuntimeStateCache runtimeStates,
      KubernetesMachineCache machines,
      StartSynchronizerFactory startSynchronizerFactory,
      Set<InternalEnvironmentProvisioner> internalEnvironmentProvisioners,
      KubernetesEnvironmentProvisioner<E> kubernetesEnvironmentProvisioner,
      SidecarToolingProvisioner<E> toolingProvisioner,
      RuntimeHangingDetector runtimeHangingDetector,
      PreviewUrlCommandProvisioner previewUrlCommandProvisioner,
      SecretAsContainerResourceProvisioner secretAsContainerResourceProvisioner,
      KubernetesServerResolverFactory kubernetesServerResolverFactory,
      RuntimeCleaner runtimeCleaner,
      CheNamespace cheNamespace,
      Tracer tracer,
      @Assisted KubernetesRuntimeContext<E> context,
      @Assisted KubernetesNamespace namespace); void scheduleRuntimeStateChecks(); CompletableFuture<Void> waitRunningAsync(
      List<CompletableFuture<?>> toCancelFutures, KubernetesMachineImpl machine); @Override Map<String, ? extends KubernetesMachineImpl> getInternalMachines(); @Override List<? extends Command> getCommands(); @Override Map<String, String> getProperties(); @Override WorkspaceStatus getStatus(); void scheduleServersCheckers(); boolean isConsistent();  }
@Test public void testGatewayRouteConfigsAreCreatedAsConfigmapsInCheNamespace() throws InfrastructureException { ConfigMap cmRoute1 = new ConfigMapBuilder() .withNewMetadata() .withName("route1") .withAnnotations(ImmutableMap.of(CREATE_IN_CHE_INSTALLATION_NAMESPACE, "true")) .endMetadata() .build(); ConfigMap cmRoute2 = new ConfigMapBuilder() .withNewMetadata() .withName("route2") .withAnnotations(ImmutableMap.of(CREATE_IN_CHE_INSTALLATION_NAMESPACE, "true")) .endMetadata() .build(); ConfigMap cm3 = new ConfigMapBuilder().withNewMetadata().withName("route2").endMetadata().build(); Map<String, ConfigMap> configMaps = ImmutableMap.of("route1", cmRoute1, "route2", cmRoute2, "cm3", cm3); when(k8sEnv.getConfigMaps()).thenReturn(configMaps); List<ConfigMap> expectedCreatedCheNamespaceConfigmaps = Arrays.asList(cmRoute1, cmRoute2); internalRuntime.start(emptyMap()); verify(cheNamespace) .createConfigMaps( expectedCreatedCheNamespaceConfigmaps, internalRuntime.getContext().getIdentity()); verify(runtimeCleaner).cleanUp(namespace, WORKSPACE_ID); }