From 600450a4065d5970ea5048ba07c13a609454f4ff Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Thu, 6 Oct 2022 14:24:54 +0000 Subject: [PATCH] fix: Remove reliance of `relative_path` on subdomains This broke all relative path applications. --- provisioner/terraform/resources.go | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index ef6eb4dfd78bf..923a09bd2bc79 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -25,16 +25,13 @@ type agentAttributes struct { // A mapping of attributes on the "coder_app" resource. type agentAppAttributes struct { - AgentID string `mapstructure:"agent_id"` - Name string `mapstructure:"name"` - Icon string `mapstructure:"icon"` - URL string `mapstructure:"url"` - Command string `mapstructure:"command"` - Subdomain bool `mapstructure:"subdomain"` - // RelativePath is deprecated in favor of Subdomain. This value is a pointer - // because we prefer it over Subdomain it was explicitly set. - RelativePath *bool `mapstructure:"relative_path"` - Healthcheck []appHealthcheckAttributes `mapstructure:"healthcheck"` + AgentID string `mapstructure:"agent_id"` + Name string `mapstructure:"name"` + Icon string `mapstructure:"icon"` + URL string `mapstructure:"url"` + Command string `mapstructure:"command"` + Subdomain bool `mapstructure:"subdomain"` + Healthcheck []appHealthcheckAttributes `mapstructure:"healthcheck"` } // A mapping of attributes on the "healthcheck" resource. @@ -238,12 +235,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res } } - // Default attrs.RelativePath to true if unspecified in Terraform. subdomain := attrs.Subdomain - if attrs.RelativePath != nil { - subdomain = !*attrs.RelativePath - } - for _, agents := range resourceAgents { for _, agent := range agents { // Find agents with the matching ID and associate them!