diff --git a/coderd/database/migrations/000056_app_subdomain_fix.down.sql b/coderd/database/migrations/000056_app_subdomain_fix.down.sql new file mode 100644 index 0000000000..e95cb5d1f6 --- /dev/null +++ b/coderd/database/migrations/000056_app_subdomain_fix.down.sql @@ -0,0 +1 @@ +-- nothing diff --git a/coderd/database/migrations/000056_app_subdomain_fix.up.sql b/coderd/database/migrations/000056_app_subdomain_fix.up.sql new file mode 100644 index 0000000000..dc56c85a9a --- /dev/null +++ b/coderd/database/migrations/000056_app_subdomain_fix.up.sql @@ -0,0 +1,12 @@ +-- There was a mistake in the last migration which set "subdomain" to be the +-- opposite of the deprecated value "relative_path", however the "relative_path" +-- value may not have been correct as it was not consumed anywhere prior to this +-- point. +-- +-- Force all workspace apps to use path based routing until rebuild. This should +-- not impact any existing workspaces as the only supported routing method has +-- been path based routing prior to this point. +-- +-- On rebuild the value from the Terraform template will be used instead +-- (defaulting to false if unspecified). +UPDATE "workspace_apps" SET "subdomain" = false; diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index 923a09bd2b..e629625323 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -235,7 +235,6 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res } } - subdomain := attrs.Subdomain for _, agents := range resourceAgents { for _, agent := range agents { // Find agents with the matching ID and associate them! @@ -247,7 +246,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res Command: attrs.Command, Url: attrs.URL, Icon: attrs.Icon, - Subdomain: subdomain, + Subdomain: attrs.Subdomain, Healthcheck: healthcheck, }) }