use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class ImagePullSecretProvisioner method provision.
@Override
@Traced
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException {
TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId);
DockerAuthConfigs credentials = credentialsProvider.getCredentials();
if (credentials == null) {
return;
}
Map<String, DockerAuthConfig> authConfigs = credentials.getConfigs();
if (authConfigs == null || authConfigs.isEmpty()) {
return;
}
String encodedConfig = Base64.getEncoder().encodeToString(generateDockerCfg(authConfigs).getBytes());
Secret secret = new SecretBuilder().addToData(".dockercfg", encodedConfig).withType("kubernetes.io/dockercfg").withNewMetadata().withName(identity.getWorkspaceId() + SECRET_NAME_SUFFIX).endMetadata().build();
k8sEnv.getSecrets().put(secret.getMetadata().getName(), secret);
k8sEnv.getPodsData().values().forEach(p -> addImagePullSecret(secret.getMetadata().getName(), p.getSpec()));
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class RestartPolicyRewriter method provision.
@Override
@Traced
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException {
TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId);
for (PodData podConfig : k8sEnv.getPodsData().values()) {
final String podName = podConfig.getMetadata().getName();
final PodSpec podSpec = podConfig.getSpec();
rewriteRestartPolicy(podSpec, podName, k8sEnv);
}
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class ServiceAccountProvisioner method provision.
@Override
@Traced
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity) throws InfrastructureException {
TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId);
if (!isNullOrEmpty(serviceAccount)) {
for (PodData pod : k8sEnv.getPodsData().values()) {
pod.getSpec().setServiceAccountName(serviceAccount);
pod.getSpec().setAutomountServiceAccountToken(true);
}
}
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class RouteTlsProvisioner method provision.
@Override
@Traced
public void provision(OpenShiftEnvironment osEnv, RuntimeIdentity identity) {
TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId);
if (!isTlsEnabled) {
return;
}
final Set<Route> routes = new HashSet<>(osEnv.getRoutes().values());
for (Route route : routes) {
useSecureProtocolForServers(route);
enableTls(route);
}
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class OpenShiftInternalRuntime method startMachines.
@Override
@Traced
protected void startMachines() throws InfrastructureException {
OpenShiftEnvironment osEnv = getContext().getEnvironment();
String workspaceId = getContext().getIdentity().getWorkspaceId();
createSecrets(osEnv, workspaceId);
List<ConfigMap> createdConfigMaps = createConfigMaps(osEnv, getContext().getIdentity());
List<Service> createdServices = createServices(osEnv, workspaceId);
List<Route> createdRoutes = createRoutes(osEnv, workspaceId);
listenEvents();
doStartMachine(serverResolverFactory.create(createdServices, createdRoutes, createdConfigMaps));
}
Aggregations