From dbb2e0e5c1fd3fa25a871e561764da4c052e39d9 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 29 Sep 2022 12:53:29 +0000 Subject: [PATCH 01/10] feat: use app wildcards for apps if configured --- coderd/workspaceagents.go | 9 ++-- codersdk/workspaceapps.go | 5 ++ site/src/api/typesGenerated.ts | 1 + .../components/AppLink/AppLink.stories.tsx | 10 ++-- site/src/components/AppLink/AppLink.tsx | 51 ++++++++++++++++--- site/src/components/Resources/Resources.tsx | 4 +- 6 files changed, 63 insertions(+), 17 deletions(-) diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index 180de3654e94e..d94030f729921 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -489,10 +489,11 @@ func convertApps(dbApps []database.WorkspaceApp) []codersdk.WorkspaceApp { apps := make([]codersdk.WorkspaceApp, 0) for _, dbApp := range dbApps { apps = append(apps, codersdk.WorkspaceApp{ - ID: dbApp.ID, - Name: dbApp.Name, - Command: dbApp.Command.String, - Icon: dbApp.Icon, + ID: dbApp.ID, + Name: dbApp.Name, + Command: dbApp.Command.String, + Icon: dbApp.Icon, + RelativePath: dbApp.RelativePath, Healthcheck: codersdk.Healthcheck{ URL: dbApp.HealthcheckUrl, Interval: dbApp.HealthcheckInterval, diff --git a/codersdk/workspaceapps.go b/codersdk/workspaceapps.go index 168e3c0d597c9..cec00c38b1ad7 100644 --- a/codersdk/workspaceapps.go +++ b/codersdk/workspaceapps.go @@ -21,6 +21,11 @@ type WorkspaceApp struct { // Icon is a relative path or external URL that specifies // an icon to be displayed in the dashboard. Icon string `json:"icon,omitempty"` + // RelativePath denotes whether the app should be accessed via a path on the + // `coder server` or via a hostname-based dev URL. If this is set to false + // and there is no app wildcard configured on the server, the app will not + // be accessible in the UI. + RelativePath bool `json:"relative_path"` // Healthcheck specifies the configuration for checking app health. Healthcheck Healthcheck `json:"healthcheck"` Health WorkspaceAppHealth `json:"health"` diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index fdacbc6dacadf..7ee9d2476a8e8 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -602,6 +602,7 @@ export interface WorkspaceApp { readonly name: string readonly command?: string readonly icon?: string + readonly relative_path: boolean readonly healthcheck: Healthcheck readonly health: WorkspaceAppHealth } diff --git a/site/src/components/AppLink/AppLink.stories.tsx b/site/src/components/AppLink/AppLink.stories.tsx index eb7fd8bbb7d14..f232870999f0d 100644 --- a/site/src/components/AppLink/AppLink.stories.tsx +++ b/site/src/components/AppLink/AppLink.stories.tsx @@ -11,7 +11,7 @@ const Template: Story = (args) => export const WithIcon = Template.bind({}) WithIcon.args = { - userName: "developer", + username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", appIcon: "/icon/code.svg", @@ -20,7 +20,7 @@ WithIcon.args = { export const WithoutIcon = Template.bind({}) WithoutIcon.args = { - userName: "developer", + username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", health: "healthy", @@ -28,7 +28,7 @@ WithoutIcon.args = { export const HealthDisabled = Template.bind({}) HealthDisabled.args = { - userName: "developer", + username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", health: "disabled", @@ -36,7 +36,7 @@ HealthDisabled.args = { export const HealthInitializing = Template.bind({}) HealthInitializing.args = { - userName: "developer", + username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", health: "initializing", @@ -44,7 +44,7 @@ HealthInitializing.args = { export const HealthUnhealthy = Template.bind({}) HealthUnhealthy.args = { - userName: "developer", + username: "developer", workspaceName: MockWorkspace.name, appName: "code-server", health: "unhealthy", diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 1d09404720f7e..4d2293bbcd146 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -1,58 +1,82 @@ import Button from "@material-ui/core/Button" import CircularProgress from "@material-ui/core/CircularProgress" import Link from "@material-ui/core/Link" +import Tooltip from "@material-ui/core/Tooltip" import { makeStyles } from "@material-ui/core/styles" import ComputerIcon from "@material-ui/icons/Computer" import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline" import { FC, PropsWithChildren } from "react" import * as TypesGen from "../../api/typesGenerated" import { generateRandomString } from "../../util/random" +import { ChooseOne, Cond } from "components/Conditionals/ChooseOne" export const Language = { appTitle: (appName: string, identifier: string): string => `${appName} - ${identifier}`, } export interface AppLinkProps { - userName: TypesGen.User["username"] + appsHost?: string, + username: TypesGen.User["username"] workspaceName: TypesGen.Workspace["name"] agentName: TypesGen.WorkspaceAgent["name"] appName: TypesGen.WorkspaceApp["name"] appIcon?: TypesGen.WorkspaceApp["icon"] appCommand?: TypesGen.WorkspaceApp["command"] + appRelativePath: TypesGen.WorkspaceApp["relative_path"] health: TypesGen.WorkspaceApp["health"] } export const AppLink: FC> = ({ - userName, + appsHost, + username, workspaceName, agentName, appName, appIcon, appCommand, + appRelativePath, health, }) => { const styles = useStyles() // The backend redirects if the trailing slash isn't included, so we add it // here to avoid extra roundtrips. - let href = `/@${userName}/${workspaceName}.${agentName}/apps/${encodeURIComponent(appName)}/` + let href = `/@${username}/${workspaceName}.${agentName}/apps/${encodeURIComponent(appName)}/` if (appCommand) { - href = `/@${userName}/${workspaceName}.${agentName}/terminal?command=${encodeURIComponent( + href = `/@${username}/${workspaceName}.${agentName}/terminal?command=${encodeURIComponent( appCommand, )}` } + if (appsHost && !appRelativePath) { + const subdomain = `${appName}--${agentName}--${workspaceName}--${username}` + href = `${window.location.protocol}://${subdomain}.${appsHost}/` + } let canClick = true let icon = appIcon ? {`${appName} : + let tooltip: string | undefined = undefined if (health === "initializing") { canClick = false icon = + tooltip = "Initializing..." } if (health === "unhealthy") { canClick = false icon = + tooltip = "Unhealthy" + } + if (!appsHost && !appRelativePath) { + canClick = false + icon = + tooltip = "Your admin has not configured wildcard application access" } + const button = ( + + ) + return ( > = ({ : undefined } > - + + + + + {button} + + + + + {button} + + ) } @@ -95,4 +128,8 @@ const useStyles = makeStyles((theme) => ({ unhealthyIcon: { color: theme.palette.warning.light, }, + + notConfiguredIcon: { + color: theme.palette.grey[300], + }, })) diff --git a/site/src/components/Resources/Resources.tsx b/site/src/components/Resources/Resources.tsx index 65e7de7a8fd7e..4f57bc0a9a81a 100644 --- a/site/src/components/Resources/Resources.tsx +++ b/site/src/components/Resources/Resources.tsx @@ -175,10 +175,12 @@ export const Resources: FC> = ({ {agent.apps.map((app) => ( Date: Thu, 29 Sep 2022 13:43:43 +0000 Subject: [PATCH 02/10] fixup! feat: use app wildcards for apps if configured --- site/src/testHelpers/entities.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/site/src/testHelpers/entities.ts b/site/src/testHelpers/entities.ts index 177e79842e22d..6baa2ed35eb6b 100644 --- a/site/src/testHelpers/entities.ts +++ b/site/src/testHelpers/entities.ts @@ -328,6 +328,7 @@ export const MockWorkspaceApp: TypesGen.WorkspaceApp = { id: "test-app", name: "test-app", icon: "", + relative_path: true, health: "disabled", healthcheck: { url: "", From 5bd46a94577ebb0a38ffc7a4bdbc01747bba2d3b Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 4 Oct 2022 14:48:06 +0000 Subject: [PATCH 03/10] feat: working tooltips on disabled app buttons --- site/src/components/AppLink/AppLink.tsx | 58 +++++++++++-------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 4d2293bbcd146..91e8c69314f8a 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -1,21 +1,20 @@ import Button from "@material-ui/core/Button" import CircularProgress from "@material-ui/core/CircularProgress" import Link from "@material-ui/core/Link" -import Tooltip from "@material-ui/core/Tooltip" import { makeStyles } from "@material-ui/core/styles" +import Tooltip from "@material-ui/core/Tooltip" import ComputerIcon from "@material-ui/icons/Computer" import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline" import { FC, PropsWithChildren } from "react" import * as TypesGen from "../../api/typesGenerated" import { generateRandomString } from "../../util/random" -import { ChooseOne, Cond } from "components/Conditionals/ChooseOne" export const Language = { appTitle: (appName: string, identifier: string): string => `${appName} - ${identifier}`, } export interface AppLinkProps { - appsHost?: string, + appsHost?: string username: TypesGen.User["username"] workspaceName: TypesGen.Workspace["name"] agentName: TypesGen.WorkspaceAgent["name"] @@ -54,7 +53,7 @@ export const AppLink: FC> = ({ let canClick = true let icon = appIcon ? {`${appName} : - let tooltip: string | undefined = undefined + let tooltip = "" if (health === "initializing") { canClick = false icon = @@ -78,36 +77,29 @@ export const AppLink: FC> = ({ ) return ( - { - event.preventDefault() - window.open( - href, - Language.appTitle(appName, generateRandomString(12)), - "width=900,height=600", - ) - } - : undefined - } - > - - - - - {button} - - - - + + + { + event.preventDefault() + window.open( + href, + Language.appTitle(appName, generateRandomString(12)), + "width=900,height=600", + ) + } + : undefined + } + > {button} - - - + + + ) } From 35596a7907c7f09492fabdc6fb906a4b8ba8fe10 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 4 Oct 2022 15:08:08 +0000 Subject: [PATCH 04/10] feat: default apps relative_path to true --- provisioner/terraform/resources.go | 23 +++- provisioner/terraform/resources_test.go | 28 ++-- .../testdata/multiple-apps/multiple-apps.tf | 13 +- .../multiple-apps/multiple-apps.tfplan.dot | 3 + .../multiple-apps/multiple-apps.tfplan.json | 120 ++++++++++++------ .../multiple-apps/multiple-apps.tfstate.dot | 3 + .../multiple-apps/multiple-apps.tfstate.json | 54 +++++--- 7 files changed, 168 insertions(+), 76 deletions(-) diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index 22685c566120a..70da4a9c2efca 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -27,12 +27,14 @@ 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"` - RelativePath bool `mapstructure:"relative_path"` + AgentID string `mapstructure:"agent_id"` + Name string `mapstructure:"name"` + Icon string `mapstructure:"icon"` + URL string `mapstructure:"url"` + Command string `mapstructure:"command"` + // RelativePath is optional, but it defaults to true so we have to make it + // a pointer to be backwards compatible. + RelativePath *bool `mapstructure:"relative_path"` Healthcheck []appHealthcheckAttributes `mapstructure:"healthcheck"` } @@ -238,6 +240,13 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res Threshold: attrs.Healthcheck[0].Threshold, } } + + // Default attrs.RelativePath to true if unspecified in Terraform. + relativePath := true + if attrs.RelativePath != nil { + relativePath = *attrs.RelativePath + } + for _, agents := range resourceAgents { for _, agent := range agents { // Find agents with the matching ID and associate them! @@ -249,7 +258,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res Command: attrs.Command, Url: attrs.URL, Icon: attrs.Icon, - RelativePath: attrs.RelativePath, + RelativePath: relativePath, Healthcheck: healthcheck, }) } diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index 7330a215eac17..f50ed99a126a2 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -108,16 +108,26 @@ func TestConvertResources(t *testing.T) { Name: "dev1", OperatingSystem: "linux", Architecture: "amd64", - Apps: []*proto.App{{ - Name: "app1", - }, { - Name: "app2", - Healthcheck: &proto.Healthcheck{ - Url: "http://localhost:13337/healthz", - Interval: 5, - Threshold: 6, + Apps: []*proto.App{ + { + Name: "app1", + // RelativePath defaults to true if unspecified. + RelativePath: true, }, - }}, + { + Name: "app2", + RelativePath: false, + Healthcheck: &proto.Healthcheck{ + Url: "http://localhost:13337/healthz", + Interval: 5, + Threshold: 6, + }, + }, + { + Name: "app3", + RelativePath: true, + }, + }, Auth: &proto.Agent_Token{}, }}, }}, diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf index 02e42868839c8..370c2cf9bda42 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf @@ -12,12 +12,17 @@ resource "coder_agent" "dev1" { arch = "amd64" } +# app1 is for testing relative_path default. resource "coder_app" "app1" { agent_id = coder_agent.dev1.id + # relative_path should default to true. + # relative_path = true } +# app2 tests that relative_path can be false, and that healthchecks work. resource "coder_app" "app2" { - agent_id = coder_agent.dev1.id + agent_id = coder_agent.dev1.id + relative_path = false healthcheck { url = "http://localhost:13337/healthz" interval = 5 @@ -25,6 +30,12 @@ resource "coder_app" "app2" { } } +# app3 tests that relative_path can explicitly be true. +resource "coder_app" "app3" { + agent_id = coder_agent.dev1.id + relative_path = true +} + resource "null_resource" "dev" { depends_on = [ coder_agent.dev1 diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.dot b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.dot index 30e381a044d33..b072ccafce750 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.dot +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.dot @@ -5,16 +5,19 @@ digraph { "[root] coder_agent.dev1 (expand)" [label = "coder_agent.dev1", shape = "box"] "[root] coder_app.app1 (expand)" [label = "coder_app.app1", shape = "box"] "[root] coder_app.app2 (expand)" [label = "coder_app.app2", shape = "box"] + "[root] coder_app.app3 (expand)" [label = "coder_app.app3", shape = "box"] "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] "[root] provider[\"registry.terraform.io/coder/coder\"]" [label = "provider[\"registry.terraform.io/coder/coder\"]", shape = "diamond"] "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] "[root] coder_agent.dev1 (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" "[root] coder_app.app1 (expand)" -> "[root] coder_agent.dev1 (expand)" "[root] coder_app.app2 (expand)" -> "[root] coder_agent.dev1 (expand)" + "[root] coder_app.app3 (expand)" -> "[root] coder_agent.dev1 (expand)" "[root] null_resource.dev (expand)" -> "[root] coder_agent.dev1 (expand)" "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_app.app1 (expand)" "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_app.app2 (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_app.app3 (expand)" "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" "[root] root" -> "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json index 6b117d913769a..3115259b4444d 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json @@ -58,13 +58,30 @@ ], "icon": null, "name": null, - "relative_path": null, + "relative_path": false, "url": null }, "sensitive_values": { - "healthcheck": [ - {} - ] + "healthcheck": [{}] + } + }, + { + "address": "coder_app.app3", + "mode": "managed", + "type": "coder_app", + "name": "app3", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "command": null, + "healthcheck": [], + "icon": null, + "name": null, + "relative_path": true, + "url": null + }, + "sensitive_values": { + "healthcheck": [] } }, { @@ -90,9 +107,7 @@ "name": "dev1", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -120,9 +135,7 @@ "name": "app1", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "command": null, @@ -150,9 +163,7 @@ "name": "app2", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "command": null, @@ -165,21 +176,45 @@ ], "icon": null, "name": null, - "relative_path": null, + "relative_path": false, "url": null }, "after_unknown": { "agent_id": true, - "healthcheck": [ - {} - ], + "healthcheck": [{}], "id": true }, "before_sensitive": false, "after_sensitive": { - "healthcheck": [ - {} - ] + "healthcheck": [{}] + } + } + }, + { + "address": "coder_app.app3", + "mode": "managed", + "type": "coder_app", + "name": "app3", + "provider_name": "registry.terraform.io/coder/coder", + "change": { + "actions": ["create"], + "before": null, + "after": { + "command": null, + "healthcheck": [], + "icon": null, + "name": null, + "relative_path": true, + "url": null + }, + "after_unknown": { + "agent_id": true, + "healthcheck": [], + "id": true + }, + "before_sensitive": false, + "after_sensitive": { + "healthcheck": [] } } }, @@ -190,9 +225,7 @@ "name": "dev", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -210,7 +243,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.14" + "version_constraint": "0.4.15" }, "null": { "name": "null", @@ -243,10 +276,7 @@ "provider_config_key": "coder", "expressions": { "agent_id": { - "references": [ - "coder_agent.dev1.id", - "coder_agent.dev1" - ] + "references": ["coder_agent.dev1.id", "coder_agent.dev1"] } }, "schema_version": 0 @@ -259,10 +289,7 @@ "provider_config_key": "coder", "expressions": { "agent_id": { - "references": [ - "coder_agent.dev1.id", - "coder_agent.dev1" - ] + "references": ["coder_agent.dev1.id", "coder_agent.dev1"] }, "healthcheck": [ { @@ -276,7 +303,26 @@ "constant_value": "http://localhost:13337/healthz" } } - ] + ], + "relative_path": { + "constant_value": false + } + }, + "schema_version": 0 + }, + { + "address": "coder_app.app3", + "mode": "managed", + "type": "coder_app", + "name": "app3", + "provider_config_key": "coder", + "expressions": { + "agent_id": { + "references": ["coder_agent.dev1.id", "coder_agent.dev1"] + }, + "relative_path": { + "constant_value": true + } }, "schema_version": 0 }, @@ -287,9 +333,7 @@ "name": "dev", "provider_config_key": "null", "schema_version": 0, - "depends_on": [ - "coder_agent.dev1" - ] + "depends_on": ["coder_agent.dev1"] } ] } @@ -297,9 +341,7 @@ "relevant_attributes": [ { "resource": "coder_agent.dev1", - "attribute": [ - "id" - ] + "attribute": ["id"] } ] } diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.dot b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.dot index 30e381a044d33..b072ccafce750 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.dot +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.dot @@ -5,16 +5,19 @@ digraph { "[root] coder_agent.dev1 (expand)" [label = "coder_agent.dev1", shape = "box"] "[root] coder_app.app1 (expand)" [label = "coder_app.app1", shape = "box"] "[root] coder_app.app2 (expand)" [label = "coder_app.app2", shape = "box"] + "[root] coder_app.app3 (expand)" [label = "coder_app.app3", shape = "box"] "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] "[root] provider[\"registry.terraform.io/coder/coder\"]" [label = "provider[\"registry.terraform.io/coder/coder\"]", shape = "diamond"] "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] "[root] coder_agent.dev1 (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" "[root] coder_app.app1 (expand)" -> "[root] coder_agent.dev1 (expand)" "[root] coder_app.app2 (expand)" -> "[root] coder_agent.dev1 (expand)" + "[root] coder_app.app3 (expand)" -> "[root] coder_agent.dev1 (expand)" "[root] null_resource.dev (expand)" -> "[root] coder_agent.dev1 (expand)" "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_app.app1 (expand)" "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_app.app2 (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_app.app3 (expand)" "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" "[root] root" -> "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json index c703dd490e878..7f5bf36c66593 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "685dba1f-09de-40c0-8fc0-4d8ca00ef946", + "id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", "init_script": "", "os": "linux", "startup_script": null, - "token": "2c73d680-ef4c-4bc1-80f0-f6916e4e5255" + "token": "d2fad8bf-9459-41d7-8d92-ca9940b2aaa1" }, "sensitive_values": {} }, @@ -32,11 +32,11 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "685dba1f-09de-40c0-8fc0-4d8ca00ef946", + "agent_id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", "command": null, "healthcheck": [], "icon": null, - "id": "46f8d3cd-bcf7-4792-8d54-66e01e63018a", + "id": "c34b36d3-3df6-40c3-b9ab-f037ac169d2d", "name": null, "relative_path": null, "url": null @@ -44,9 +44,7 @@ "sensitive_values": { "healthcheck": [] }, - "depends_on": [ - "coder_agent.dev1" - ] + "depends_on": ["coder_agent.dev1"] }, { "address": "coder_app.app2", @@ -56,7 +54,7 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "685dba1f-09de-40c0-8fc0-4d8ca00ef946", + "agent_id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", "command": null, "healthcheck": [ { @@ -66,19 +64,37 @@ } ], "icon": null, - "id": "e4556c74-2f67-4266-b1e8-7ee61d754583", + "id": "8bf1946d-7065-46e3-87b8-3e4c156e8ba9", "name": null, - "relative_path": null, + "relative_path": false, "url": null }, "sensitive_values": { - "healthcheck": [ - {} - ] + "healthcheck": [{}] + }, + "depends_on": ["coder_agent.dev1"] + }, + { + "address": "coder_app.app3", + "mode": "managed", + "type": "coder_app", + "name": "app3", + "provider_name": "registry.terraform.io/coder/coder", + "schema_version": 0, + "values": { + "agent_id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", + "command": null, + "healthcheck": [], + "icon": null, + "id": "c4680ef4-c50b-4f58-8a50-955123dbb605", + "name": null, + "relative_path": true, + "url": null + }, + "sensitive_values": { + "healthcheck": [] }, - "depends_on": [ - "coder_agent.dev1" - ] + "depends_on": ["coder_agent.dev1"] }, { "address": "null_resource.dev", @@ -88,13 +104,11 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "2997000197756647168", + "id": "7137797065891134588", "triggers": null }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.dev1" - ] + "depends_on": ["coder_agent.dev1"] } ] } From 6a8339e21d0b8871d230d2dba413c82c687149d0 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 4 Oct 2022 19:09:29 +0000 Subject: [PATCH 05/10] feat: relative_path -> subdomain - rename relative_path -> subdomain when referring to apps - migrate workspace_apps.relative_path to workspace_apps.subdomain - upgrade coder/coder terraform module to 0.5.0 --- coderd/database/databasefake/databasefake.go | 2 +- coderd/database/dump.sql | 4 +- ...000055_relative_path_to_subdomain.down.sql | 8 + .../000055_relative_path_to_subdomain.up.sql | 8 + coderd/database/models.go | 2 +- coderd/database/queries.sql.go | 26 +- coderd/database/queries/workspaceapps.sql | 2 +- coderd/provisionerdaemons.go | 2 +- coderd/telemetry/telemetry.go | 20 +- coderd/workspaceagents.go | 10 +- codersdk/workspaceapps.go | 6 +- dogfood/main.tf | 2 +- examples/templates/aws-ecs-container/main.tf | 12 +- examples/templates/aws-linux/main.tf | 2 +- examples/templates/aws-windows/main.tf | 2 +- examples/templates/azure-linux/main.tf | 2 +- examples/templates/do-linux/main.tf | 2 +- examples/templates/docker-code-server/main.tf | 2 +- .../templates/docker-image-builds/main.tf | 2 +- .../templates/docker-with-dotfiles/main.tf | 2 +- examples/templates/docker/main.tf | 2 +- examples/templates/gcp-linux/main.tf | 12 +- examples/templates/gcp-vm-container/main.tf | 12 +- examples/templates/gcp-windows/main.tf | 2 +- examples/templates/kubernetes/main.tf | 12 +- provisioner/terraform/resources.go | 34 +-- provisioner/terraform/resources_test.go | 12 +- .../testdata/calling-module/calling-module.tf | 2 +- .../calling-module/calling-module.tfplan.json | 35 +-- .../calling-module.tfstate.json | 8 +- .../chaining-resources/chaining-resources.tf | 2 +- .../chaining-resources.tfplan.json | 26 +- .../chaining-resources.tfstate.json | 17 +- .../conflicting-resources.tf | 2 +- .../conflicting-resources.tfplan.json | 26 +- .../conflicting-resources.tfstate.json | 16 +- .../testdata/instance-id/instance-id.tf | 2 +- .../instance-id/instance-id.tfplan.json | 31 +- .../instance-id/instance-id.tfstate.json | 18 +- .../multiple-agents/multiple-agents.tf | 2 +- .../multiple-agents.tfplan.json | 30 +- .../multiple-agents.tfstate.json | 14 +- .../testdata/multiple-apps/multiple-apps.tf | 20 +- .../multiple-apps/multiple-apps.tfplan.json | 24 +- .../multiple-apps/multiple-apps.tfstate.json | 25 +- .../resource-metadata/resource-metadata.tf | 2 +- .../resource-metadata.tfplan.json | 41 +-- .../resource-metadata.tfstate.json | 21 +- provisionersdk/proto/provisioner.pb.go | 272 +++++++++--------- provisionersdk/proto/provisioner.proto | 2 +- site/src/api/typesGenerated.ts | 2 +- site/src/components/AppLink/AppLink.tsx | 8 +- site/src/components/Resources/Resources.tsx | 2 +- site/src/testHelpers/entities.ts | 2 +- 54 files changed, 398 insertions(+), 458 deletions(-) create mode 100644 coderd/database/migrations/000055_relative_path_to_subdomain.down.sql create mode 100644 coderd/database/migrations/000055_relative_path_to_subdomain.up.sql diff --git a/coderd/database/databasefake/databasefake.go b/coderd/database/databasefake/databasefake.go index 839633f7f815e..2e80dc393016c 100644 --- a/coderd/database/databasefake/databasefake.go +++ b/coderd/database/databasefake/databasefake.go @@ -2042,7 +2042,7 @@ func (q *fakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW Icon: arg.Icon, Command: arg.Command, Url: arg.Url, - RelativePath: arg.RelativePath, + Subdomain: arg.Subdomain, HealthcheckUrl: arg.HealthcheckUrl, HealthcheckInterval: arg.HealthcheckInterval, HealthcheckThreshold: arg.HealthcheckThreshold, diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index 9413e0822d154..a773f1e2f3fcb 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -352,11 +352,11 @@ CREATE TABLE workspace_apps ( icon character varying(256) NOT NULL, command character varying(65534), url character varying(65534), - relative_path boolean DEFAULT false NOT NULL, healthcheck_url text DEFAULT ''::text NOT NULL, healthcheck_interval integer DEFAULT 0 NOT NULL, healthcheck_threshold integer DEFAULT 0 NOT NULL, - health workspace_app_health DEFAULT 'disabled'::public.workspace_app_health NOT NULL + health workspace_app_health DEFAULT 'disabled'::public.workspace_app_health NOT NULL, + subdomain boolean DEFAULT false NOT NULL ); CREATE TABLE workspace_builds ( diff --git a/coderd/database/migrations/000055_relative_path_to_subdomain.down.sql b/coderd/database/migrations/000055_relative_path_to_subdomain.down.sql new file mode 100644 index 0000000000000..013146cdd450a --- /dev/null +++ b/coderd/database/migrations/000055_relative_path_to_subdomain.down.sql @@ -0,0 +1,8 @@ +-- Add column relative_path of type bool to workspace_apps +ALTER TABLE "workspace_apps" ADD COLUMN "relative_path" bool NOT NULL DEFAULT false; + +-- Set column relative_path to the opposite of subdomain +UPDATE "workspace_apps" SET "relative_path" = NOT "subdomain"; + +-- Drop column subdomain +ALTER TABLE "workspace_apps" DROP COLUMN "subdomain"; diff --git a/coderd/database/migrations/000055_relative_path_to_subdomain.up.sql b/coderd/database/migrations/000055_relative_path_to_subdomain.up.sql new file mode 100644 index 0000000000000..6476799479888 --- /dev/null +++ b/coderd/database/migrations/000055_relative_path_to_subdomain.up.sql @@ -0,0 +1,8 @@ +-- Add column subdomain of type bool to workspace_apps +ALTER TABLE "workspace_apps" ADD COLUMN "subdomain" bool NOT NULL DEFAULT false; + +-- Set column subdomain to the opposite of relative_path +UPDATE "workspace_apps" SET "subdomain" = NOT "relative_path"; + +-- Drop column relative_path +ALTER TABLE "workspace_apps" DROP COLUMN "relative_path"; diff --git a/coderd/database/models.go b/coderd/database/models.go index bfd7d3f7af1ad..b64e54d01c5ea 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -605,11 +605,11 @@ type WorkspaceApp struct { Icon string `db:"icon" json:"icon"` Command sql.NullString `db:"command" json:"command"` Url sql.NullString `db:"url" json:"url"` - RelativePath bool `db:"relative_path" json:"relative_path"` HealthcheckUrl string `db:"healthcheck_url" json:"healthcheck_url"` HealthcheckInterval int32 `db:"healthcheck_interval" json:"healthcheck_interval"` HealthcheckThreshold int32 `db:"healthcheck_threshold" json:"healthcheck_threshold"` Health WorkspaceAppHealth `db:"health" json:"health"` + Subdomain bool `db:"subdomain" json:"subdomain"` } type WorkspaceBuild struct { diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 669a9d2e07d84..82c4664a39dc4 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -3893,7 +3893,7 @@ func (q *sqlQuerier) UpdateWorkspaceAgentVersionByID(ctx context.Context, arg Up } const getWorkspaceAppByAgentIDAndName = `-- name: GetWorkspaceAppByAgentIDAndName :one -SELECT id, created_at, agent_id, name, icon, command, url, relative_path, healthcheck_url, healthcheck_interval, healthcheck_threshold, health FROM workspace_apps WHERE agent_id = $1 AND name = $2 +SELECT id, created_at, agent_id, name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain FROM workspace_apps WHERE agent_id = $1 AND name = $2 ` type GetWorkspaceAppByAgentIDAndNameParams struct { @@ -3912,17 +3912,17 @@ func (q *sqlQuerier) GetWorkspaceAppByAgentIDAndName(ctx context.Context, arg Ge &i.Icon, &i.Command, &i.Url, - &i.RelativePath, &i.HealthcheckUrl, &i.HealthcheckInterval, &i.HealthcheckThreshold, &i.Health, + &i.Subdomain, ) return i, err } const getWorkspaceAppsByAgentID = `-- name: GetWorkspaceAppsByAgentID :many -SELECT id, created_at, agent_id, name, icon, command, url, relative_path, healthcheck_url, healthcheck_interval, healthcheck_threshold, health FROM workspace_apps WHERE agent_id = $1 ORDER BY name ASC +SELECT id, created_at, agent_id, name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain FROM workspace_apps WHERE agent_id = $1 ORDER BY name ASC ` func (q *sqlQuerier) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid.UUID) ([]WorkspaceApp, error) { @@ -3942,11 +3942,11 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid &i.Icon, &i.Command, &i.Url, - &i.RelativePath, &i.HealthcheckUrl, &i.HealthcheckInterval, &i.HealthcheckThreshold, &i.Health, + &i.Subdomain, ); err != nil { return nil, err } @@ -3962,7 +3962,7 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid } const getWorkspaceAppsByAgentIDs = `-- name: GetWorkspaceAppsByAgentIDs :many -SELECT id, created_at, agent_id, name, icon, command, url, relative_path, healthcheck_url, healthcheck_interval, healthcheck_threshold, health FROM workspace_apps WHERE agent_id = ANY($1 :: uuid [ ]) ORDER BY name ASC +SELECT id, created_at, agent_id, name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain FROM workspace_apps WHERE agent_id = ANY($1 :: uuid [ ]) ORDER BY name ASC ` func (q *sqlQuerier) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid.UUID) ([]WorkspaceApp, error) { @@ -3982,11 +3982,11 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid. &i.Icon, &i.Command, &i.Url, - &i.RelativePath, &i.HealthcheckUrl, &i.HealthcheckInterval, &i.HealthcheckThreshold, &i.Health, + &i.Subdomain, ); err != nil { return nil, err } @@ -4002,7 +4002,7 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid. } const getWorkspaceAppsCreatedAfter = `-- name: GetWorkspaceAppsCreatedAfter :many -SELECT id, created_at, agent_id, name, icon, command, url, relative_path, healthcheck_url, healthcheck_interval, healthcheck_threshold, health FROM workspace_apps WHERE created_at > $1 ORDER BY name ASC +SELECT id, created_at, agent_id, name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain FROM workspace_apps WHERE created_at > $1 ORDER BY name ASC ` func (q *sqlQuerier) GetWorkspaceAppsCreatedAfter(ctx context.Context, createdAt time.Time) ([]WorkspaceApp, error) { @@ -4022,11 +4022,11 @@ func (q *sqlQuerier) GetWorkspaceAppsCreatedAfter(ctx context.Context, createdAt &i.Icon, &i.Command, &i.Url, - &i.RelativePath, &i.HealthcheckUrl, &i.HealthcheckInterval, &i.HealthcheckThreshold, &i.Health, + &i.Subdomain, ); err != nil { return nil, err } @@ -4051,14 +4051,14 @@ INSERT INTO icon, command, url, - relative_path, + subdomain, healthcheck_url, healthcheck_interval, healthcheck_threshold, health ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING id, created_at, agent_id, name, icon, command, url, relative_path, healthcheck_url, healthcheck_interval, healthcheck_threshold, health + ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING id, created_at, agent_id, name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain ` type InsertWorkspaceAppParams struct { @@ -4069,7 +4069,7 @@ type InsertWorkspaceAppParams struct { Icon string `db:"icon" json:"icon"` Command sql.NullString `db:"command" json:"command"` Url sql.NullString `db:"url" json:"url"` - RelativePath bool `db:"relative_path" json:"relative_path"` + Subdomain bool `db:"subdomain" json:"subdomain"` HealthcheckUrl string `db:"healthcheck_url" json:"healthcheck_url"` HealthcheckInterval int32 `db:"healthcheck_interval" json:"healthcheck_interval"` HealthcheckThreshold int32 `db:"healthcheck_threshold" json:"healthcheck_threshold"` @@ -4085,7 +4085,7 @@ func (q *sqlQuerier) InsertWorkspaceApp(ctx context.Context, arg InsertWorkspace arg.Icon, arg.Command, arg.Url, - arg.RelativePath, + arg.Subdomain, arg.HealthcheckUrl, arg.HealthcheckInterval, arg.HealthcheckThreshold, @@ -4100,11 +4100,11 @@ func (q *sqlQuerier) InsertWorkspaceApp(ctx context.Context, arg InsertWorkspace &i.Icon, &i.Command, &i.Url, - &i.RelativePath, &i.HealthcheckUrl, &i.HealthcheckInterval, &i.HealthcheckThreshold, &i.Health, + &i.Subdomain, ) return i, err } diff --git a/coderd/database/queries/workspaceapps.sql b/coderd/database/queries/workspaceapps.sql index 61ea2d7e397a4..3336bfda4ad74 100644 --- a/coderd/database/queries/workspaceapps.sql +++ b/coderd/database/queries/workspaceapps.sql @@ -20,7 +20,7 @@ INSERT INTO icon, command, url, - relative_path, + subdomain, healthcheck_url, healthcheck_interval, healthcheck_threshold, diff --git a/coderd/provisionerdaemons.go b/coderd/provisionerdaemons.go index 95fc2806db41f..bef1110ec3bb0 100644 --- a/coderd/provisionerdaemons.go +++ b/coderd/provisionerdaemons.go @@ -828,7 +828,7 @@ func insertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid. String: app.Url, Valid: app.Url != "", }, - RelativePath: app.RelativePath, + Subdomain: app.Subdomain, HealthcheckUrl: app.Healthcheck.Url, HealthcheckInterval: app.Healthcheck.Interval, HealthcheckThreshold: app.Healthcheck.Threshold, diff --git a/coderd/telemetry/telemetry.go b/coderd/telemetry/telemetry.go index 6008619584a0b..dc525fd2589be 100644 --- a/coderd/telemetry/telemetry.go +++ b/coderd/telemetry/telemetry.go @@ -528,11 +528,11 @@ func ConvertWorkspaceAgent(agent database.WorkspaceAgent) WorkspaceAgent { // ConvertWorkspaceApp anonymizes a workspace app. func ConvertWorkspaceApp(app database.WorkspaceApp) WorkspaceApp { return WorkspaceApp{ - ID: app.ID, - CreatedAt: app.CreatedAt, - AgentID: app.AgentID, - Icon: app.Icon, - RelativePath: app.RelativePath, + ID: app.ID, + CreatedAt: app.CreatedAt, + AgentID: app.AgentID, + Icon: app.Icon, + Subdomain: app.Subdomain, } } @@ -692,11 +692,11 @@ type WorkspaceAgent struct { } type WorkspaceApp struct { - ID uuid.UUID `json:"id"` - CreatedAt time.Time `json:"created_at"` - AgentID uuid.UUID `json:"agent_id"` - Icon string `json:"icon"` - RelativePath bool `json:"relative_path"` + ID uuid.UUID `json:"id"` + CreatedAt time.Time `json:"created_at"` + AgentID uuid.UUID `json:"agent_id"` + Icon string `json:"icon"` + Subdomain bool `json:"subdomain"` } type WorkspaceBuild struct { diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index d94030f729921..21bcd2bff16a0 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -489,11 +489,11 @@ func convertApps(dbApps []database.WorkspaceApp) []codersdk.WorkspaceApp { apps := make([]codersdk.WorkspaceApp, 0) for _, dbApp := range dbApps { apps = append(apps, codersdk.WorkspaceApp{ - ID: dbApp.ID, - Name: dbApp.Name, - Command: dbApp.Command.String, - Icon: dbApp.Icon, - RelativePath: dbApp.RelativePath, + ID: dbApp.ID, + Name: dbApp.Name, + Command: dbApp.Command.String, + Icon: dbApp.Icon, + Subdomain: dbApp.Subdomain, Healthcheck: codersdk.Healthcheck{ URL: dbApp.HealthcheckUrl, Interval: dbApp.HealthcheckInterval, diff --git a/codersdk/workspaceapps.go b/codersdk/workspaceapps.go index cec00c38b1ad7..7de4217bac999 100644 --- a/codersdk/workspaceapps.go +++ b/codersdk/workspaceapps.go @@ -21,11 +21,11 @@ type WorkspaceApp struct { // Icon is a relative path or external URL that specifies // an icon to be displayed in the dashboard. Icon string `json:"icon,omitempty"` - // RelativePath denotes whether the app should be accessed via a path on the - // `coder server` or via a hostname-based dev URL. If this is set to false + // Subdomain denotes whether the app should be accessed via a path on the + // `coder server` or via a hostname-based dev URL. If this is set to true // and there is no app wildcard configured on the server, the app will not // be accessible in the UI. - RelativePath bool `json:"relative_path"` + Subdomain bool `json:"subdomain"` // Healthcheck specifies the configuration for checking app health. Healthcheck Healthcheck `json:"healthcheck"` Health WorkspaceAppHealth `json:"health"` diff --git a/dogfood/main.tf b/dogfood/main.tf index 007aee3846ce6..e79cfff402027 100644 --- a/dogfood/main.tf +++ b/dogfood/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } docker = { source = "kreuzwerker/docker" diff --git a/examples/templates/aws-ecs-container/main.tf b/examples/templates/aws-ecs-container/main.tf index a63b5af3f0f42..a1b48ef0eeba3 100644 --- a/examples/templates/aws-ecs-container/main.tf +++ b/examples/templates/aws-ecs-container/main.tf @@ -6,7 +6,7 @@ terraform { } coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } @@ -105,11 +105,11 @@ resource "coder_agent" "coder" { } resource "coder_app" "code-server" { - agent_id = coder_agent.coder.id - name = "code-server" - icon = "/icon/code.svg" - url = "http://localhost:13337?folder=/home/coder" - relative_path = true + agent_id = coder_agent.coder.id + name = "code-server" + icon = "/icon/code.svg" + url = "http://localhost:13337?folder=/home/coder" + subdomain = false healthcheck { url = "http://localhost:1337/healthz" diff --git a/examples/templates/aws-linux/main.tf b/examples/templates/aws-linux/main.tf index 7ead586e05a51..c3dbae4a37539 100644 --- a/examples/templates/aws-linux/main.tf +++ b/examples/templates/aws-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/examples/templates/aws-windows/main.tf b/examples/templates/aws-windows/main.tf index 2c995c1e87579..960f1d88aa16c 100644 --- a/examples/templates/aws-windows/main.tf +++ b/examples/templates/aws-windows/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/examples/templates/azure-linux/main.tf b/examples/templates/azure-linux/main.tf index 33ed6d0170342..e40fb4f5104a4 100644 --- a/examples/templates/azure-linux/main.tf +++ b/examples/templates/azure-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } azurerm = { source = "hashicorp/azurerm" diff --git a/examples/templates/do-linux/main.tf b/examples/templates/do-linux/main.tf index 526bd4f65bba9..375d61c3a1c5c 100644 --- a/examples/templates/do-linux/main.tf +++ b/examples/templates/do-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } digitalocean = { source = "digitalocean/digitalocean" diff --git a/examples/templates/docker-code-server/main.tf b/examples/templates/docker-code-server/main.tf index 1c16784a9cd74..3f91f0796b118 100644 --- a/examples/templates/docker-code-server/main.tf +++ b/examples/templates/docker-code-server/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } docker = { source = "kreuzwerker/docker" diff --git a/examples/templates/docker-image-builds/main.tf b/examples/templates/docker-image-builds/main.tf index 556e1f2a21a47..3d603a580b4c3 100644 --- a/examples/templates/docker-image-builds/main.tf +++ b/examples/templates/docker-image-builds/main.tf @@ -3,7 +3,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } docker = { source = "kreuzwerker/docker" diff --git a/examples/templates/docker-with-dotfiles/main.tf b/examples/templates/docker-with-dotfiles/main.tf index 594cdb72d39e4..1db205ad0eb7e 100644 --- a/examples/templates/docker-with-dotfiles/main.tf +++ b/examples/templates/docker-with-dotfiles/main.tf @@ -9,7 +9,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } docker = { source = "kreuzwerker/docker" diff --git a/examples/templates/docker/main.tf b/examples/templates/docker/main.tf index 36ce85da7f5f3..f3be4669a77dc 100644 --- a/examples/templates/docker/main.tf +++ b/examples/templates/docker/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } docker = { source = "kreuzwerker/docker" diff --git a/examples/templates/gcp-linux/main.tf b/examples/templates/gcp-linux/main.tf index b4706e3d5280e..25c14ceba9e7d 100644 --- a/examples/templates/gcp-linux/main.tf +++ b/examples/templates/gcp-linux/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } google = { source = "hashicorp/google" @@ -60,11 +60,11 @@ resource "coder_agent" "main" { # code-server resource "coder_app" "code-server" { - agent_id = coder_agent.main.id - name = "code-server" - icon = "/icon/code.svg" - url = "http://localhost:13337?folder=/home/coder" - relative_path = true + agent_id = coder_agent.main.id + name = "code-server" + icon = "/icon/code.svg" + url = "http://localhost:13337?folder=/home/coder" + subdomain = false healthcheck { url = "http://localhost:1337/healthz" diff --git a/examples/templates/gcp-vm-container/main.tf b/examples/templates/gcp-vm-container/main.tf index 58ebd42050495..f7aa36e4f32d3 100644 --- a/examples/templates/gcp-vm-container/main.tf +++ b/examples/templates/gcp-vm-container/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } google = { source = "hashicorp/google" @@ -50,11 +50,11 @@ resource "coder_agent" "main" { # code-server resource "coder_app" "code-server" { - agent_id = coder_agent.main.id - name = "code-server" - icon = "/icon/code.svg" - url = "http://localhost:13337?folder=/home/coder" - relative_path = true + agent_id = coder_agent.main.id + name = "code-server" + icon = "/icon/code.svg" + url = "http://localhost:13337?folder=/home/coder" + subdomain = false healthcheck { url = "http://localhost:1337/healthz" diff --git a/examples/templates/gcp-windows/main.tf b/examples/templates/gcp-windows/main.tf index 25e1e90bd9f9c..e9f65d332c839 100644 --- a/examples/templates/gcp-windows/main.tf +++ b/examples/templates/gcp-windows/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } google = { source = "hashicorp/google" diff --git a/examples/templates/kubernetes/main.tf b/examples/templates/kubernetes/main.tf index c48c78ecd13b0..5138a2ca35dab 100644 --- a/examples/templates/kubernetes/main.tf +++ b/examples/templates/kubernetes/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } kubernetes = { source = "hashicorp/kubernetes" @@ -71,11 +71,11 @@ resource "coder_agent" "main" { # code-server resource "coder_app" "code-server" { - agent_id = coder_agent.main.id - name = "code-server" - icon = "/icon/code.svg" - url = "http://localhost:13337?folder=/home/coder" - relative_path = true + agent_id = coder_agent.main.id + name = "code-server" + icon = "/icon/code.svg" + url = "http://localhost:13337?folder=/home/coder" + subdomain = false healthcheck { url = "http://localhost:1337/healthz" diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index 70da4a9c2efca..0d52f448b5509 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -1,8 +1,6 @@ package terraform import ( - "encoding/json" - "fmt" "strings" "github.com/awalterschulze/gographviz" @@ -27,13 +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"` - // RelativePath is optional, but it defaults to true so we have to make it - // a pointer to be backwards compatible. + 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. RelativePath *bool `mapstructure:"relative_path"` Healthcheck []appHealthcheckAttributes `mapstructure:"healthcheck"` } @@ -224,8 +222,6 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res var attrs agentAppAttributes err = mapstructure.Decode(resource.AttributeValues, &attrs) if err != nil { - d, _ := json.MarshalIndent(resource.AttributeValues, "", " ") - fmt.Print(string(d)) return nil, xerrors.Errorf("decode app attributes: %w", err) } if attrs.Name == "" { @@ -242,9 +238,9 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res } // Default attrs.RelativePath to true if unspecified in Terraform. - relativePath := true + subdomain := attrs.Subdomain if attrs.RelativePath != nil { - relativePath = *attrs.RelativePath + subdomain = !*attrs.RelativePath } for _, agents := range resourceAgents { @@ -254,12 +250,12 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res continue } agent.Apps = append(agent.Apps, &proto.App{ - Name: attrs.Name, - Command: attrs.Command, - Url: attrs.URL, - Icon: attrs.Icon, - RelativePath: relativePath, - Healthcheck: healthcheck, + Name: attrs.Name, + Command: attrs.Command, + Url: attrs.URL, + Icon: attrs.Icon, + Subdomain: subdomain, + Healthcheck: healthcheck, }) } } diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index f50ed99a126a2..4034ee395eaed 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -111,12 +111,12 @@ func TestConvertResources(t *testing.T) { Apps: []*proto.App{ { Name: "app1", - // RelativePath defaults to true if unspecified. - RelativePath: true, + // Subdomain defaults to false if unspecified. + Subdomain: false, }, { - Name: "app2", - RelativePath: false, + Name: "app2", + Subdomain: true, Healthcheck: &proto.Healthcheck{ Url: "http://localhost:13337/healthz", Interval: 5, @@ -124,8 +124,8 @@ func TestConvertResources(t *testing.T) { }, }, { - Name: "app3", - RelativePath: true, + Name: "app3", + Subdomain: false, }, }, Auth: &proto.Agent_Token{}, diff --git a/provisioner/terraform/testdata/calling-module/calling-module.tf b/provisioner/terraform/testdata/calling-module/calling-module.tf index 894e082e30aab..6c6289c30db4f 100644 --- a/provisioner/terraform/testdata/calling-module/calling-module.tf +++ b/provisioner/terraform/testdata/calling-module/calling-module.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json b/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json index 9748cc53b9801..3d491cb410264 100644 --- a/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json +++ b/provisioner/terraform/testdata/calling-module/calling-module.tfplan.json @@ -66,9 +66,7 @@ "name": "main", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -84,7 +82,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -95,9 +95,7 @@ "name": "script", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "read" - ], + "actions": ["read"], "before": null, "after": { "inputs": {} @@ -127,9 +125,7 @@ "name": "example", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -147,7 +143,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.11" + "version_constraint": "0.5.0" }, "module.module:null": { "name": "null", @@ -179,10 +175,7 @@ "source": "./module", "expressions": { "script": { - "references": [ - "coder_agent.main.init_script", - "coder_agent.main" - ] + "references": ["coder_agent.main.init_script", "coder_agent.main"] } }, "module": { @@ -194,9 +187,7 @@ "name": "example", "provider_config_key": "module.module:null", "schema_version": 0, - "depends_on": [ - "data.null_data_source.script" - ] + "depends_on": ["data.null_data_source.script"] }, { "address": "data.null_data_source.script", @@ -206,9 +197,7 @@ "provider_config_key": "module.module:null", "expressions": { "inputs": { - "references": [ - "var.script" - ] + "references": ["var.script"] } }, "schema_version": 0 @@ -225,9 +214,7 @@ "relevant_attributes": [ { "resource": "coder_agent.main", - "attribute": [ - "init_script" - ] + "attribute": ["init_script"] } ] } diff --git a/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json b/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json index fe61412e402c2..b9a30bec50faf 100644 --- a/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json +++ b/provisioner/terraform/testdata/calling-module/calling-module.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "f5435556-71b4-4e9c-a961-474ef4c70836", + "id": "b92bd0ce-d854-47af-a2f6-4941cd5dbd27", "init_script": "", "os": "linux", "startup_script": null, - "token": "cbe1cec2-8c52-4411-ab1b-c7e9aa4e93ea" + "token": "3f1b6b3f-7ea9-4944-bef4-8be9b78db8ae" }, "sensitive_values": {} } @@ -44,7 +44,7 @@ "outputs": { "script": "" }, - "random": "2977741887145450154" + "random": "5257014674084238393" }, "sensitive_values": { "inputs": {}, @@ -59,7 +59,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3098344175322958112", + "id": "6805057619323391144", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tf b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tf index fb9c1fb0ffaa4..3f7a212667e84 100644 --- a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tf +++ b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json index f82c9851aa283..44698e6885524 100644 --- a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json +++ b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json @@ -56,9 +56,7 @@ "name": "main", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -74,7 +72,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -84,9 +84,7 @@ "name": "a", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -105,9 +103,7 @@ "name": "b", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -125,7 +121,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.11" + "version_constraint": "0.5.0" }, "null": { "name": "null", @@ -157,9 +153,7 @@ "name": "a", "provider_config_key": "null", "schema_version": 0, - "depends_on": [ - "null_resource.b" - ] + "depends_on": ["null_resource.b"] }, { "address": "null_resource.b", @@ -168,9 +162,7 @@ "name": "b", "provider_config_key": "null", "schema_version": 0, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] } ] } diff --git a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json index 1986782431efb..91ac75eb21f25 100644 --- a/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json +++ b/provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "846b2cd1-1dcc-4b26-ad71-8508c8d71738", + "id": "d8de89cb-bb6b-4f4f-80f8-e5d39e8c5f62", "init_script": "", "os": "linux", "startup_script": null, - "token": "3a3e4e25-6be2-4b51-a369-957fdb243a4f" + "token": "4e877d5c-95c4-4365-b9a1-856348b54f43" }, "sensitive_values": {} }, @@ -32,14 +32,11 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "8441562949971496089", + "id": "2870641260310442024", "triggers": null }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.main", - "null_resource.b" - ] + "depends_on": ["coder_agent.main", "null_resource.b"] }, { "address": "null_resource.b", @@ -49,13 +46,11 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "4737933879128730392", + "id": "7093709823890756895", "triggers": null }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] } ] } diff --git a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tf b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tf index d5b50dcd864b9..7ae15e86731f9 100644 --- a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tf +++ b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json index f0235d2f174c4..0ec3af57e4da7 100644 --- a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json +++ b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json @@ -56,9 +56,7 @@ "name": "main", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -74,7 +72,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -84,9 +84,7 @@ "name": "first", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -105,9 +103,7 @@ "name": "second", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -125,7 +121,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.11" + "version_constraint": "0.5.0" }, "null": { "name": "null", @@ -157,9 +153,7 @@ "name": "first", "provider_config_key": "null", "schema_version": 0, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] }, { "address": "null_resource.second", @@ -168,9 +162,7 @@ "name": "second", "provider_config_key": "null", "schema_version": 0, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] } ] } diff --git a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json index c9c411da2b9fd..4e41f6cf6a797 100644 --- a/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json +++ b/provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "2efd4acf-bb30-4713-98b5-21fef293c995", + "id": "5c00c97c-7291-47b7-96cf-3ac7d7588a99", "init_script": "", "os": "linux", "startup_script": null, - "token": "7db84d6e-c079-4b4a-99e0-e2414a70df84" + "token": "a1939d12-8b8a-414b-b745-3fac020e51c0" }, "sensitive_values": {} }, @@ -32,13 +32,11 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "6618109150570768254", + "id": "8930370582092686733", "triggers": null }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] }, { "address": "null_resource.second", @@ -48,13 +46,11 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "4505836003282545145", + "id": "8209925920170986769", "triggers": null }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] } ] } diff --git a/provisioner/terraform/testdata/instance-id/instance-id.tf b/provisioner/terraform/testdata/instance-id/instance-id.tf index 3e92a8d7799a6..f474e4993aad2 100644 --- a/provisioner/terraform/testdata/instance-id/instance-id.tf +++ b/provisioner/terraform/testdata/instance-id/instance-id.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json b/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json index 45462912024ea..595ad74f7d078 100644 --- a/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json +++ b/provisioner/terraform/testdata/instance-id/instance-id.tfplan.json @@ -56,9 +56,7 @@ "name": "main", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -74,7 +72,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -84,9 +84,7 @@ "name": "main", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "instance_id": "example" @@ -106,9 +104,7 @@ "name": "main", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -126,7 +122,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.11" + "version_constraint": "0.5.0" }, "null": { "name": "null", @@ -162,10 +158,7 @@ "provider_config_key": "coder", "expressions": { "agent_id": { - "references": [ - "coder_agent.main.id", - "coder_agent.main" - ] + "references": ["coder_agent.main.id", "coder_agent.main"] }, "instance_id": { "constant_value": "example" @@ -180,9 +173,7 @@ "name": "main", "provider_config_key": "null", "schema_version": 0, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] } ] } @@ -190,9 +181,7 @@ "relevant_attributes": [ { "resource": "coder_agent.main", - "attribute": [ - "id" - ] + "attribute": ["id"] } ] } diff --git a/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json b/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json index c726acf85432d..13b36ffa1f936 100644 --- a/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json +++ b/provisioner/terraform/testdata/instance-id/instance-id.tfstate.json @@ -16,11 +16,11 @@ "auth": "google-instance-identity", "dir": null, "env": null, - "id": "e2d2e12e-1975-4bca-8a96-67d6b303b25b", + "id": "248ed639-3dbe-479e-909a-37d5d226529f", "init_script": "", "os": "linux", "startup_script": null, - "token": "87ba2736-3519-4368-b9ee-4132bd042fe3" + "token": "8bee2595-095f-4965-ade2-deef475023d6" }, "sensitive_values": {} }, @@ -32,14 +32,12 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "e2d2e12e-1975-4bca-8a96-67d6b303b25b", - "id": "979121e7-2a41-432a-aa90-8b0d2d802b50", + "agent_id": "248ed639-3dbe-479e-909a-37d5d226529f", + "id": "edbfac7a-a88d-433a-ab7c-be3816656477", "instance_id": "example" }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] }, { "address": "null_resource.main", @@ -49,13 +47,11 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3316746911978433294", + "id": "5674804341417746589", "triggers": null }, "sensitive_values": {}, - "depends_on": [ - "coder_agent.main" - ] + "depends_on": ["coder_agent.main"] } ] } diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf index 5186fc26a09b2..379612d2f3aa2 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json index e859a094d8b24..df8e4d92adfba 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json @@ -78,9 +78,7 @@ "name": "dev1", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -96,7 +94,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -106,9 +106,7 @@ "name": "dev2", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -124,7 +122,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -134,9 +134,7 @@ "name": "dev3", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "arm64", @@ -152,7 +150,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -162,9 +162,7 @@ "name": "dev", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -182,7 +180,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.11" + "version_constraint": "0.5.0" }, "null": { "name": "null", diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json index 56b5e1cc708c3..1bf2f1e189802 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "032d71aa-570d-4d0a-bce8-57b9d884b694", + "id": "882ce97a-3c12-410f-8916-e3bc03862162", "init_script": "", "os": "linux", "startup_script": null, - "token": "7a0df6bf-313d-4f73-ba2c-6532d72cb808" + "token": "b24ba29b-8cb3-42da-91c5-599c7be310f7" }, "sensitive_values": {} }, @@ -36,11 +36,11 @@ "auth": "token", "dir": null, "env": null, - "id": "019ae4b9-ae5c-4837-be16-dae99b911acf", + "id": "8a26cec7-3189-4eaf-99a1-1dce00b756dc", "init_script": "", "os": "darwin", "startup_script": null, - "token": "9f4adbf4-9113-42f4-bb84-d1621262b1e2" + "token": "6a155e3b-3279-40cb-9c16-4b827b561bc1" }, "sensitive_values": {} }, @@ -56,11 +56,11 @@ "auth": "token", "dir": null, "env": null, - "id": "8f2c3b12-e112-405e-9fbf-fe540ed3fe21", + "id": "57486477-64a5-4fea-8223-dbf3c259d710", "init_script": "", "os": "windows", "startup_script": null, - "token": "1a6ddbc7-77a9-43c2-9e60-c84d3ecf512a" + "token": "0fa9933e-802a-4d6a-b273-43c05993e52a" }, "sensitive_values": {} }, @@ -72,7 +72,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "6351611769218065391", + "id": "8587500025119121667", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf index 370c2cf9bda42..678c600616b3a 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } @@ -12,17 +12,17 @@ resource "coder_agent" "dev1" { arch = "amd64" } -# app1 is for testing relative_path default. +# app1 is for testing subdomain default. resource "coder_app" "app1" { agent_id = coder_agent.dev1.id - # relative_path should default to true. - # relative_path = true + # subdomain should default to false. + # subdomain = false } -# app2 tests that relative_path can be false, and that healthchecks work. +# app2 tests that subdomaincan be true, and that healthchecks work. resource "coder_app" "app2" { - agent_id = coder_agent.dev1.id - relative_path = false + agent_id = coder_agent.dev1.id + subdomain = true healthcheck { url = "http://localhost:13337/healthz" interval = 5 @@ -30,10 +30,10 @@ resource "coder_app" "app2" { } } -# app3 tests that relative_path can explicitly be true. +# app3 tests that subdomain can explicitly be false. resource "coder_app" "app3" { - agent_id = coder_agent.dev1.id - relative_path = true + agent_id = coder_agent.dev1.id + subdomain = false } resource "null_resource" "dev" { diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json index 3115259b4444d..93f60329583f7 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json @@ -34,6 +34,7 @@ "icon": null, "name": null, "relative_path": null, + "subdomain": null, "url": null }, "sensitive_values": { @@ -58,7 +59,8 @@ ], "icon": null, "name": null, - "relative_path": false, + "relative_path": null, + "subdomain": true, "url": null }, "sensitive_values": { @@ -77,7 +79,8 @@ "healthcheck": [], "icon": null, "name": null, - "relative_path": true, + "relative_path": null, + "subdomain": false, "url": null }, "sensitive_values": { @@ -143,6 +146,7 @@ "icon": null, "name": null, "relative_path": null, + "subdomain": null, "url": null }, "after_unknown": { @@ -176,7 +180,8 @@ ], "icon": null, "name": null, - "relative_path": false, + "relative_path": null, + "subdomain": true, "url": null }, "after_unknown": { @@ -204,7 +209,8 @@ "healthcheck": [], "icon": null, "name": null, - "relative_path": true, + "relative_path": null, + "subdomain": false, "url": null }, "after_unknown": { @@ -243,7 +249,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.15" + "version_constraint": "0.5.0" }, "null": { "name": "null", @@ -304,8 +310,8 @@ } } ], - "relative_path": { - "constant_value": false + "subdomain": { + "constant_value": true } }, "schema_version": 0 @@ -320,8 +326,8 @@ "agent_id": { "references": ["coder_agent.dev1.id", "coder_agent.dev1"] }, - "relative_path": { - "constant_value": true + "subdomain": { + "constant_value": false } }, "schema_version": 0 diff --git a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json index 7f5bf36c66593..14b90e4cc2395 100644 --- a/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json +++ b/provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", + "id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126", "init_script": "", "os": "linux", "startup_script": null, - "token": "d2fad8bf-9459-41d7-8d92-ca9940b2aaa1" + "token": "7e748146-cea2-45cb-927d-b4a90b0021b3" }, "sensitive_values": {} }, @@ -32,13 +32,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", + "agent_id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126", "command": null, "healthcheck": [], "icon": null, - "id": "c34b36d3-3df6-40c3-b9ab-f037ac169d2d", + "id": "95667002-bd60-4d2c-9313-0666f66c44ff", "name": null, "relative_path": null, + "subdomain": null, "url": null }, "sensitive_values": { @@ -54,7 +55,7 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", + "agent_id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126", "command": null, "healthcheck": [ { @@ -64,9 +65,10 @@ } ], "icon": null, - "id": "8bf1946d-7065-46e3-87b8-3e4c156e8ba9", + "id": "817c6904-69e1-485f-a057-4ddac83a9c5a", "name": null, - "relative_path": false, + "relative_path": null, + "subdomain": true, "url": null }, "sensitive_values": { @@ -82,13 +84,14 @@ "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { - "agent_id": "67cbc78d-21de-4cc0-8e47-aa67a051ce56", + "agent_id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126", "command": null, "healthcheck": [], "icon": null, - "id": "c4680ef4-c50b-4f58-8a50-955123dbb605", + "id": "c4a502b3-cc82-4fdf-952b-4b429e711798", "name": null, - "relative_path": true, + "relative_path": null, + "subdomain": false, "url": null }, "sensitive_values": { @@ -104,7 +107,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "7137797065891134588", + "id": "1281108380136021489", "triggers": null }, "sensitive_values": {}, diff --git a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tf b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tf index 110f07099db70..26734569b66be 100644 --- a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tf +++ b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.4.15" + version = "0.5.0" } } } diff --git a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json index 64ab537cedc1a..6f45e70fd6e69 100644 --- a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json +++ b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json @@ -55,12 +55,7 @@ ] }, "sensitive_values": { - "item": [ - {}, - {}, - {}, - {} - ] + "item": [{}, {}, {}, {}] } }, { @@ -86,9 +81,7 @@ "name": "main", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "arch": "amd64", @@ -104,7 +97,9 @@ "token": true }, "before_sensitive": false, - "after_sensitive": {} + "after_sensitive": { + "token": true + } } }, { @@ -114,9 +109,7 @@ "name": "about_info", "provider_name": "registry.terraform.io/coder/coder", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "hide": true, @@ -164,12 +157,7 @@ }, "before_sensitive": false, "after_sensitive": { - "item": [ - {}, - {}, - {}, - {} - ] + "item": [{}, {}, {}, {}] } } }, @@ -180,9 +168,7 @@ "name": "about", "provider_name": "registry.terraform.io/hashicorp/null", "change": { - "actions": [ - "create" - ], + "actions": ["create"], "before": null, "after": { "triggers": null @@ -200,7 +186,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.4.11" + "version_constraint": "0.5.0" }, "null": { "name": "null", @@ -273,10 +259,7 @@ } ], "resource_id": { - "references": [ - "null_resource.about.id", - "null_resource.about" - ] + "references": ["null_resource.about.id", "null_resource.about"] } }, "schema_version": 0 @@ -295,9 +278,7 @@ "relevant_attributes": [ { "resource": "null_resource.about", - "attribute": [ - "id" - ] + "attribute": ["id"] } ] } diff --git a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json index 2873d610f87ba..b759e7590dec6 100644 --- a/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json +++ b/provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json @@ -16,11 +16,11 @@ "auth": "token", "dir": null, "env": null, - "id": "50a0466c-d983-422f-8bed-9dd0bf705a9a", + "id": "0bfa269a-e373-4fbc-929a-07b8ed0f3477", "init_script": "", "os": "linux", "startup_script": null, - "token": "aa714059-3579-49d1-a0e2-3519dbe43688" + "token": "4bc54f84-7d97-492a-ad98-40ae7dfbb300" }, "sensitive_values": {} }, @@ -34,7 +34,7 @@ "values": { "hide": true, "icon": "/icon/server.svg", - "id": "64a47d31-28d0-4a50-8e09-a3e705278305", + "id": "2ee6d253-dec1-4336-95ba-bd5e93cf4c84", "item": [ { "is_null": false, @@ -61,19 +61,12 @@ "value": "squirrel" } ], - "resource_id": "4887255791781048166" + "resource_id": "3043919679469754967" }, "sensitive_values": { - "item": [ - {}, - {}, - {}, - {} - ] + "item": [{}, {}, {}, {}] }, - "depends_on": [ - "null_resource.about" - ] + "depends_on": ["null_resource.about"] }, { "address": "null_resource.about", @@ -83,7 +76,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "4887255791781048166", + "id": "3043919679469754967", "triggers": null }, "sensitive_values": {} diff --git a/provisionersdk/proto/provisioner.pb.go b/provisionersdk/proto/provisioner.pb.go index e6134519976f3..38f75b0bc179e 100644 --- a/provisionersdk/proto/provisioner.pb.go +++ b/provisionersdk/proto/provisioner.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.21.5 +// protoc v3.6.1 // source: provisionersdk/proto/provisioner.proto package proto @@ -850,12 +850,12 @@ type App struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` - Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` - Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` - RelativePath bool `protobuf:"varint,5,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"` - Healthcheck *Healthcheck `protobuf:"bytes,6,opt,name=healthcheck,proto3" json:"healthcheck,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` + Subdomain bool `protobuf:"varint,5,opt,name=subdomain,proto3" json:"subdomain,omitempty"` + Healthcheck *Healthcheck `protobuf:"bytes,6,opt,name=healthcheck,proto3" json:"healthcheck,omitempty"` } func (x *App) Reset() { @@ -918,9 +918,9 @@ func (x *App) GetIcon() string { return "" } -func (x *App) GetRelativePath() bool { +func (x *App) GetSubdomain() bool { if x != nil { - return x.RelativePath + return x.Subdomain } return false } @@ -1952,140 +1952,140 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{ 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x22, 0xba, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x22, 0xb3, 0x01, 0x0a, 0x03, 0x41, 0x70, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, - 0x3a, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x0b, - 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x22, 0x59, 0x0a, 0x0b, 0x48, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0xad, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, - 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x04, 0x68, 0x69, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x1a, 0x69, 0x0a, 0x08, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x17, 0x0a, - 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0xfc, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, - 0x1a, 0x27, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x64, - 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x1a, 0x55, 0x0a, 0x08, 0x43, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x10, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, - 0x1a, 0x73, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03, - 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c, - 0x6f, 0x67, 0x12, 0x39, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, - 0x65, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x06, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xae, 0x07, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x1a, 0xd1, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x53, 0x0a, - 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x77, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x1a, 0xd9, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x46, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, + 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, + 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x3a, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x22, 0x59, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, + 0xad, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x68, 0x69, 0x64, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x69, 0x63, 0x6f, 0x6e, 0x1a, 0x69, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x22, + 0xfc, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, 0x1a, 0x27, 0x0a, 0x07, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x79, 0x1a, 0x55, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x49, + 0x0a, 0x11, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x72, - 0x79, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x72, 0x79, - 0x52, 0x75, 0x6e, 0x1a, 0x08, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x80, 0x01, - 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x10, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x1a, 0x73, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x39, 0x0a, 0x08, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, + 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, + 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xae, + 0x07, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xd1, 0x02, 0x0a, + 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, + 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, + 0x64, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x53, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2c, + 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x1a, 0xd9, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x10, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, + 0x0f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x72, 0x79, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x72, 0x79, 0x52, 0x75, 0x6e, 0x1a, 0x08, 0x0a, 0x06, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x80, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, + 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x00, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x37, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x48, 0x00, - 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x1a, 0x6b, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x77, 0x0a, - 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x6c, 0x6f, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, - 0x3d, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, - 0x74, 0x65, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x06, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, 0x3f, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, - 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, - 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x2a, 0x37, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, - 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, - 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x02, - 0x32, 0xa3, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, - 0x12, 0x42, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, - 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x6b, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x6b, 0x0a, 0x08, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x77, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, + 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x3d, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x00, 0x52, 0x08, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, + 0x3f, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x54, + 0x52, 0x41, 0x43, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, + 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x57, + 0x41, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, + 0x2a, 0x37, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x02, 0x32, 0xa3, 0x01, 0x0a, 0x0b, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x05, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x50, 0x0a, + 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, + 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/provisionersdk/proto/provisioner.proto b/provisionersdk/proto/provisioner.proto index af30e32f10524..26af34f280646 100644 --- a/provisionersdk/proto/provisioner.proto +++ b/provisionersdk/proto/provisioner.proto @@ -93,7 +93,7 @@ message App { string command = 2; string url = 3; string icon = 4; - bool relative_path = 5; + bool subdomain = 5; Healthcheck healthcheck = 6; } diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 7ee9d2476a8e8..7c5a928dfc5af 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -602,7 +602,7 @@ export interface WorkspaceApp { readonly name: string readonly command?: string readonly icon?: string - readonly relative_path: boolean + readonly subdomain: boolean readonly healthcheck: Healthcheck readonly health: WorkspaceAppHealth } diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 91e8c69314f8a..51c0be83a7b02 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -21,7 +21,7 @@ export interface AppLinkProps { appName: TypesGen.WorkspaceApp["name"] appIcon?: TypesGen.WorkspaceApp["icon"] appCommand?: TypesGen.WorkspaceApp["command"] - appRelativePath: TypesGen.WorkspaceApp["relative_path"] + appSubdomain: TypesGen.WorkspaceApp["subdomain"] health: TypesGen.WorkspaceApp["health"] } @@ -33,7 +33,7 @@ export const AppLink: FC> = ({ appName, appIcon, appCommand, - appRelativePath, + appSubdomain, health, }) => { const styles = useStyles() @@ -46,7 +46,7 @@ export const AppLink: FC> = ({ appCommand, )}` } - if (appsHost && !appRelativePath) { + if (appsHost && !appSubdomain) { const subdomain = `${appName}--${agentName}--${workspaceName}--${username}` href = `${window.location.protocol}://${subdomain}.${appsHost}/` } @@ -64,7 +64,7 @@ export const AppLink: FC> = ({ icon = tooltip = "Unhealthy" } - if (!appsHost && !appRelativePath) { + if (!appsHost && !appSubdomain) { canClick = false icon = tooltip = "Your admin has not configured wildcard application access" diff --git a/site/src/components/Resources/Resources.tsx b/site/src/components/Resources/Resources.tsx index 4f57bc0a9a81a..3ee0ce745a0f5 100644 --- a/site/src/components/Resources/Resources.tsx +++ b/site/src/components/Resources/Resources.tsx @@ -179,7 +179,7 @@ export const Resources: FC> = ({ appIcon={app.icon} appName={app.name} appCommand={app.command} - appRelativePath={app.relative_path} + appSubdomain={app.subdomain} username={workspace.owner_name} workspaceName={workspace.name} agentName={agent.name} diff --git a/site/src/testHelpers/entities.ts b/site/src/testHelpers/entities.ts index 6baa2ed35eb6b..e1a35d83bc3e2 100644 --- a/site/src/testHelpers/entities.ts +++ b/site/src/testHelpers/entities.ts @@ -328,7 +328,7 @@ export const MockWorkspaceApp: TypesGen.WorkspaceApp = { id: "test-app", name: "test-app", icon: "", - relative_path: true, + subdomain: true, health: "disabled", healthcheck: { url: "", From 4d75f5cfe3780209994670df5d675f9d254fc586 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 4 Oct 2022 19:13:33 +0000 Subject: [PATCH 06/10] fixup! feat: relative_path -> subdomain --- site/src/components/AppLink/AppLink.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 51c0be83a7b02..7fdfecd78393d 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -46,7 +46,7 @@ export const AppLink: FC> = ({ appCommand, )}` } - if (appsHost && !appSubdomain) { + if (appsHost && appSubdomain) { const subdomain = `${appName}--${agentName}--${workspaceName}--${username}` href = `${window.location.protocol}://${subdomain}.${appsHost}/` } @@ -64,10 +64,10 @@ export const AppLink: FC> = ({ icon = tooltip = "Unhealthy" } - if (!appsHost && !appSubdomain) { + if (!appsHost && appSubdomain) { canClick = false icon = - tooltip = "Your admin has not configured wildcard application access" + tooltip = "Your admin has not configured subdomain application access" } const button = ( From e51f69d7f1232e25a8c0210b48b1c4a47d841715 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 4 Oct 2022 19:30:13 +0000 Subject: [PATCH 07/10] fixup! feat: relative_path -> subdomain --- site/src/components/AppLink/AppLink.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index 7fdfecd78393d..04459d5e83b53 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -48,7 +48,7 @@ export const AppLink: FC> = ({ } if (appsHost && appSubdomain) { const subdomain = `${appName}--${agentName}--${workspaceName}--${username}` - href = `${window.location.protocol}://${subdomain}.${appsHost}/` + href = `${window.location.protocol}//${subdomain}.${appsHost}/` } let canClick = true From ea0a38fe46d5ca61f1f803deceaf794b79f3b7d2 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 4 Oct 2022 19:31:59 +0000 Subject: [PATCH 08/10] fixup! feat: relative_path -> subdomain --- provisionersdk/proto/provisioner.pb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisionersdk/proto/provisioner.pb.go b/provisionersdk/proto/provisioner.pb.go index 38f75b0bc179e..b88fc0ac1db44 100644 --- a/provisionersdk/proto/provisioner.pb.go +++ b/provisionersdk/proto/provisioner.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.6.1 +// protoc v3.21.5 // source: provisionersdk/proto/provisioner.proto package proto From 4f6ab194d3c5cefbbcfab2915a3ce4cfeb041f8b Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Wed, 5 Oct 2022 15:16:42 +0000 Subject: [PATCH 09/10] fixup! feat: relative_path -> subdomain --- provisioner/terraform/resources.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index 0d52f448b5509..ef6eb4dfd78bf 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -31,7 +31,8 @@ type agentAppAttributes struct { URL string `mapstructure:"url"` Command string `mapstructure:"command"` Subdomain bool `mapstructure:"subdomain"` - // RelativePath is deprecated in favor of 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"` } From 26b5e575db1ce1255607745881aa0150739876c6 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Wed, 5 Oct 2022 19:02:23 +0000 Subject: [PATCH 10/10] empty commit to make github actions work