Skip to content

Commit

Permalink
fixup! CHE-3359 - Starting a workspace as an user
Browse files Browse the repository at this point in the history
Signed-off-by: Snjezana Peco <[email protected]>
  • Loading branch information
snjeza committed Mar 6, 2017
1 parent bba7121 commit f698203
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public class MachineProviderImpl implements MachineInstanceProvider {
private final long cpuQuota;
private final WindowsPathEscaper windowsPathEscaper;
private final String[] dnsResolvers;
private final String cheUserId;
private final String cheDockerUserId;

@Inject
public MachineProviderImpl(DockerConnectorProvider dockerProvider,
Expand All @@ -161,7 +161,7 @@ public MachineProviderImpl(DockerConnectorProvider dockerProvider,
WindowsPathEscaper windowsPathEscaper,
@Named("che.docker.extra_hosts") Set<Set<String>> additionalHosts,
@Nullable @Named("che.docker.dns_resolvers") String[] dnsResolvers,
@Nullable @Named("che.docker.user_id") String cheUserId)
@Nullable @Named("che.docker.user_id") String cheDockerUserId)
throws IOException {
this.docker = dockerProvider.get();
this.dockerCredentials = dockerCredentials;
Expand All @@ -170,7 +170,7 @@ public MachineProviderImpl(DockerConnectorProvider dockerProvider,
this.doForcePullOnBuild = doForcePullOnBuild;
this.privilegedMode = privilegedMode;
this.snapshotUseRegistry = snapshotUseRegistry;
this.cheUserId = cheUserId;
this.cheDockerUserId = cheDockerUserId;
// use-cases:
// -1 enable unlimited swap
// 0 disable swap
Expand Down Expand Up @@ -295,7 +295,7 @@ public Instance startService(String namespace,

docker.startContainer(StartContainerParams.create(container));

if (!Strings.isNullOrEmpty(cheUserId)) {
if (!Strings.isNullOrEmpty(cheDockerUserId)) {
changeWorkingDirOwner(container, machineLogger);
}

Expand Down Expand Up @@ -552,7 +552,7 @@ private String createContainer(String workspaceId,
.withEntrypoint(toArrayIfNotNull(service.getEntrypoint()))
.withLabels(service.getLabels())
.withNetworkingConfig(networkingConfig)
.withUser(cheUserId)
.withUser(cheDockerUserId)
.withEnv(service.getEnvironment()
.entrySet()
.stream()
Expand Down

0 comments on commit f698203

Please sign in to comment.