Skip to content

fix: Reduce variables needed for Docker template #3442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 10, 2022
Merged

Conversation

kylecarbs
Copy link
Member

This should make initial setup a bit simpler!

@kylecarbs kylecarbs requested a review from bpmct August 9, 2022 23:26
@kylecarbs kylecarbs self-assigned this Aug 9, 2022
}

provider "coder" {
# host = data.coder_provisioner.me.os == "windows" ? "npipe:////.//pipe//docker_engine" : "unix:///var/run/docker.sock"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this commented out? this works on MacOS but not sure if it would on Windows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, wasn't intentional. Fixed!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool - confirmed it still works

This should make initial setup a bit simpler!
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still works!

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, liking the cleaner templates!

@@ -84,7 +46,7 @@ variable "docker_image" {
}

resource "docker_volume" "home_volume" {
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}-root"
name = "coder-${data.coder_workspace.me.owner_id}-${lower(data.coder_workspace.me.id)}-root"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change might trigger #3386 for certain users who like to keep up-to-date with our templates. I think this is a change we really want, but I'd like for some warning/notifying facility to be in place before we do.

At minimum, we should list this as a breaking change in the release notes and warn of the behavior (update template + update workspace = volume loss).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it to the release notes on the patch.

We advertise that users shouldn't stay up-to-date with our templates, so I'm not very concerned about updating.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We advertise that users shouldn't stay up-to-date with our templates, so I'm not very concerned about updating.

Hmm, I don't see this mentioned in examples or e.g. the docker template?

Anyway, my main motivation behind being extra careful about #3386 & co. is that I don't want our current users to lose confidence in Coder because they lost their volume (even if it's due to their own configuration/changes).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I can also exclude this if you feel it's sketchy. It's not needed for the improvement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to exclude it for right now. It's not worth the possible tumult for users.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I can also exclude this if you feel it's sketchy. It's not needed for the improvement.

If that's ok, we could at least defer it until we make the change to all templates? Since I don't know if/when we'll have a solution for #3386, I won't ask us to defer until then. But doing it all at once minimizes the spread, at least.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, removed!

Kyle Carberry and others added 3 commits August 10, 2022 09:01
@kylecarbs kylecarbs enabled auto-merge (squash) August 10, 2022 14:29
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed there was one more case of name->id.

PS. Beautiful work with kreuzwerker/docker 2.20.2 😍

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
@kylecarbs kylecarbs merged commit fd73d6d into main Aug 10, 2022
@kylecarbs kylecarbs deleted the simpledocker branch August 10, 2022 14:45
@OlgaKhmelevskaya
Copy link

Hello @kylecarbs , could you please add reference to the issue this pull request is related to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants