If a workspace is running a stack that's built with Docker Compose then the workspace configuration UI (https://codenvy.io/dashboard/#/workspace/USERNAME/WORKSPACENAME?tab=Env_Variables) would allow environment variables to be modified. However if a workspace is running a stack built with Dockerfile then such modification would not be allowed (not just by the UI but also for the underlying technically reasons as well, which is totally fine) but the UI would show:
Add/Edit environment variables by changing the environment type to compose
... which IMO is slightly misleading because unless the user actually understand the nuances between Dockerfile vs. Docker Compose based stacks, the wording would seem to suggest that in order to allow modification of environment variables via the UI, all that need to be done is to change something call "environment type" to "compose" (whatever that means). However in reality, if the user is running a workspace with a stack built with Dockerfile, in order to allow the modification of environment variables, the workspace has to be running a entirely different stack (or the same stack in essence but built differently using Docker Compose). And worst, because the wording is so confusing/vague, one would end up looking for the wrong thing when going through the documentations (i.e. looking for ways to change a workspace's "environment type" which makes no sense, instead of reading about the different ways a stack can be built).
So I would suggest that the wording be changed to something that more clearly describe the reason environment variables can't be modified for a particular workspace:
Add/Edit environment variables can only be done for stacks built with Docker Compose
@qiushihe I'd probably label it as an enhancement request but want to have some other ppl have their say here.
@garagatyi does Che 6 Docker SPI implementation let us pass env variables to docker run? I do recall that there were some problems with it in a current implementation, that's why Dashboard guys were able to add envs only if it's a recipe but not a Docker image.
Nothing changes here in SPI
We don't have environment variables in the workspace model, but we can add them on the recipe level in case user dashboard understands recipe content.
So as the other way to approach this problem I may suggest improvement of the UD - when the environment is dockerimage show env variables section unavailable and add a button that migrates user's workspace to compose environment to allow env variables addition. This can be easily implemented in UD and would provide better UX.
@slemeur FYI
@ashumilova is this something Dashboard can do relatively easy?
yes, this use case can be handled with the help of dashboard.
Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.
Mark the issue as fresh with /remove-lifecycle stale in a new comment.
If this issue is safe to close now please do so.
Moderators: Add lifecycle/frozen label to avoid stale mode.