mirror of https://github.com/coder/coder.git
feat: use app wildcards for apps if configured (#4263)
* feat: use app wildcards for apps if configured * 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
This commit is contained in:
parent
4f3958c831
commit
2a66395fb7
|
@ -2069,7 +2069,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,
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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";
|
|
@ -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";
|
|
@ -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 {
|
||||
|
|
|
@ -3895,7 +3895,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 {
|
||||
|
@ -3914,17 +3914,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) {
|
||||
|
@ -3944,11 +3944,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
|
||||
}
|
||||
|
@ -3964,7 +3964,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) {
|
||||
|
@ -3984,11 +3984,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
|
||||
}
|
||||
|
@ -4004,7 +4004,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) {
|
||||
|
@ -4024,11 +4024,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
|
||||
}
|
||||
|
@ -4053,14 +4053,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 {
|
||||
|
@ -4071,7 +4071,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"`
|
||||
|
@ -4087,7 +4087,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,
|
||||
|
@ -4102,11 +4102,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
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ INSERT INTO
|
|||
icon,
|
||||
command,
|
||||
url,
|
||||
relative_path,
|
||||
subdomain,
|
||||
healthcheck_url,
|
||||
healthcheck_interval,
|
||||
healthcheck_threshold,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -494,10 +494,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,
|
||||
Subdomain: dbApp.Subdomain,
|
||||
Healthcheck: codersdk.Healthcheck{
|
||||
URL: dbApp.HealthcheckUrl,
|
||||
Interval: dbApp.HealthcheckInterval,
|
||||
|
|
|
@ -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"`
|
||||
// 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.
|
||||
Subdomain bool `json:"subdomain"`
|
||||
// Healthcheck specifies the configuration for checking app health.
|
||||
Healthcheck Healthcheck `json:"healthcheck"`
|
||||
Health WorkspaceAppHealth `json:"health"`
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
digitalocean = {
|
||||
source = "digitalocean/digitalocean"
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
|
|
|
@ -3,7 +3,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
|
|
|
@ -9,7 +9,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
google = {
|
||||
source = "hashicorp/google"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package terraform
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/awalterschulze/gographviz"
|
||||
|
@ -27,12 +25,15 @@ 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"`
|
||||
Subdomain bool `mapstructure:"subdomain"`
|
||||
// RelativePath is deprecated in favor of Subdomain. This value is a pointer
|
||||
// because we prefer it over Subdomain it was explicitly set.
|
||||
RelativePath *bool `mapstructure:"relative_path"`
|
||||
Healthcheck []appHealthcheckAttributes `mapstructure:"healthcheck"`
|
||||
}
|
||||
|
||||
|
@ -222,8 +223,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 == "" {
|
||||
|
@ -238,6 +237,13 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
|
|||
Threshold: attrs.Healthcheck[0].Threshold,
|
||||
}
|
||||
}
|
||||
|
||||
// Default attrs.RelativePath to true if unspecified in Terraform.
|
||||
subdomain := attrs.Subdomain
|
||||
if attrs.RelativePath != nil {
|
||||
subdomain = !*attrs.RelativePath
|
||||
}
|
||||
|
||||
for _, agents := range resourceAgents {
|
||||
for _, agent := range agents {
|
||||
// Find agents with the matching ID and associate them!
|
||||
|
@ -245,12 +251,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: attrs.RelativePath,
|
||||
Healthcheck: healthcheck,
|
||||
Name: attrs.Name,
|
||||
Command: attrs.Command,
|
||||
Url: attrs.URL,
|
||||
Icon: attrs.Icon,
|
||||
Subdomain: subdomain,
|
||||
Healthcheck: healthcheck,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
// Subdomain defaults to false if unspecified.
|
||||
Subdomain: false,
|
||||
},
|
||||
}},
|
||||
{
|
||||
Name: "app2",
|
||||
Subdomain: true,
|
||||
Healthcheck: &proto.Healthcheck{
|
||||
Url: "http://localhost:13337/healthz",
|
||||
Interval: 5,
|
||||
Threshold: 6,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "app3",
|
||||
Subdomain: false,
|
||||
},
|
||||
},
|
||||
Auth: &proto.Agent_Token{},
|
||||
}},
|
||||
}},
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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": {},
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
26
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json
generated
vendored
26
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json
generated
vendored
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
17
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json
generated
vendored
17
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json
generated
vendored
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
26
provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json
generated
vendored
26
provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfplan.json
generated
vendored
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
16
provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json
generated
vendored
16
provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json
generated
vendored
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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": {},
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,12 +12,17 @@ resource "coder_agent" "dev1" {
|
|||
arch = "amd64"
|
||||
}
|
||||
|
||||
# app1 is for testing subdomain default.
|
||||
resource "coder_app" "app1" {
|
||||
agent_id = coder_agent.dev1.id
|
||||
# subdomain should default to false.
|
||||
# subdomain = false
|
||||
}
|
||||
|
||||
# app2 tests that subdomaincan be true, and that healthchecks work.
|
||||
resource "coder_app" "app2" {
|
||||
agent_id = coder_agent.dev1.id
|
||||
agent_id = coder_agent.dev1.id
|
||||
subdomain = true
|
||||
healthcheck {
|
||||
url = "http://localhost:13337/healthz"
|
||||
interval = 5
|
||||
|
@ -25,6 +30,12 @@ resource "coder_app" "app2" {
|
|||
}
|
||||
}
|
||||
|
||||
# app3 tests that subdomain can explicitly be false.
|
||||
resource "coder_app" "app3" {
|
||||
agent_id = coder_agent.dev1.id
|
||||
subdomain = false
|
||||
}
|
||||
|
||||
resource "null_resource" "dev" {
|
||||
depends_on = [
|
||||
coder_agent.dev1
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
"icon": null,
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": null,
|
||||
"url": null
|
||||
},
|
||||
"sensitive_values": {
|
||||
|
@ -59,12 +60,31 @@
|
|||
"icon": null,
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": true,
|
||||
"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": null,
|
||||
"subdomain": false,
|
||||
"url": null
|
||||
},
|
||||
"sensitive_values": {
|
||||
"healthcheck": []
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -90,9 +110,7 @@
|
|||
"name": "dev1",
|
||||
"provider_name": "registry.terraform.io/coder/coder",
|
||||
"change": {
|
||||
"actions": [
|
||||
"create"
|
||||
],
|
||||
"actions": ["create"],
|
||||
"before": null,
|
||||
"after": {
|
||||
"arch": "amd64",
|
||||
|
@ -120,9 +138,7 @@
|
|||
"name": "app1",
|
||||
"provider_name": "registry.terraform.io/coder/coder",
|
||||
"change": {
|
||||
"actions": [
|
||||
"create"
|
||||
],
|
||||
"actions": ["create"],
|
||||
"before": null,
|
||||
"after": {
|
||||
"command": null,
|
||||
|
@ -130,6 +146,7 @@
|
|||
"icon": null,
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": null,
|
||||
"url": null
|
||||
},
|
||||
"after_unknown": {
|
||||
|
@ -150,9 +167,7 @@
|
|||
"name": "app2",
|
||||
"provider_name": "registry.terraform.io/coder/coder",
|
||||
"change": {
|
||||
"actions": [
|
||||
"create"
|
||||
],
|
||||
"actions": ["create"],
|
||||
"before": null,
|
||||
"after": {
|
||||
"command": null,
|
||||
|
@ -166,20 +181,46 @@
|
|||
"icon": null,
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": true,
|
||||
"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": null,
|
||||
"subdomain": false,
|
||||
"url": null
|
||||
},
|
||||
"after_unknown": {
|
||||
"agent_id": true,
|
||||
"healthcheck": [],
|
||||
"id": true
|
||||
},
|
||||
"before_sensitive": false,
|
||||
"after_sensitive": {
|
||||
"healthcheck": []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -190,9 +231,7 @@
|
|||
"name": "dev",
|
||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||
"change": {
|
||||
"actions": [
|
||||
"create"
|
||||
],
|
||||
"actions": ["create"],
|
||||
"before": null,
|
||||
"after": {
|
||||
"triggers": null
|
||||
|
@ -210,7 +249,7 @@
|
|||
"coder": {
|
||||
"name": "coder",
|
||||
"full_name": "registry.terraform.io/coder/coder",
|
||||
"version_constraint": "0.4.14"
|
||||
"version_constraint": "0.5.0"
|
||||
},
|
||||
"null": {
|
||||
"name": "null",
|
||||
|
@ -243,10 +282,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 +295,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 +309,26 @@
|
|||
"constant_value": "http://localhost:13337/healthz"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"subdomain": {
|
||||
"constant_value": true
|
||||
}
|
||||
},
|
||||
"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"]
|
||||
},
|
||||
"subdomain": {
|
||||
"constant_value": false
|
||||
}
|
||||
},
|
||||
"schema_version": 0
|
||||
},
|
||||
|
@ -287,9 +339,7 @@
|
|||
"name": "dev",
|
||||
"provider_config_key": "null",
|
||||
"schema_version": 0,
|
||||
"depends_on": [
|
||||
"coder_agent.dev1"
|
||||
]
|
||||
"depends_on": ["coder_agent.dev1"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -297,9 +347,7 @@
|
|||
"relevant_attributes": [
|
||||
{
|
||||
"resource": "coder_agent.dev1",
|
||||
"attribute": [
|
||||
"id"
|
||||
]
|
||||
"attribute": ["id"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
"auth": "token",
|
||||
"dir": null,
|
||||
"env": null,
|
||||
"id": "685dba1f-09de-40c0-8fc0-4d8ca00ef946",
|
||||
"id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126",
|
||||
"init_script": "",
|
||||
"os": "linux",
|
||||
"startup_script": null,
|
||||
"token": "2c73d680-ef4c-4bc1-80f0-f6916e4e5255"
|
||||
"token": "7e748146-cea2-45cb-927d-b4a90b0021b3"
|
||||
},
|
||||
"sensitive_values": {}
|
||||
},
|
||||
|
@ -32,21 +32,20 @@
|
|||
"provider_name": "registry.terraform.io/coder/coder",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"agent_id": "685dba1f-09de-40c0-8fc0-4d8ca00ef946",
|
||||
"agent_id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126",
|
||||
"command": null,
|
||||
"healthcheck": [],
|
||||
"icon": null,
|
||||
"id": "46f8d3cd-bcf7-4792-8d54-66e01e63018a",
|
||||
"id": "95667002-bd60-4d2c-9313-0666f66c44ff",
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": null,
|
||||
"url": null
|
||||
},
|
||||
"sensitive_values": {
|
||||
"healthcheck": []
|
||||
},
|
||||
"depends_on": [
|
||||
"coder_agent.dev1"
|
||||
]
|
||||
"depends_on": ["coder_agent.dev1"]
|
||||
},
|
||||
{
|
||||
"address": "coder_app.app2",
|
||||
|
@ -56,7 +55,7 @@
|
|||
"provider_name": "registry.terraform.io/coder/coder",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"agent_id": "685dba1f-09de-40c0-8fc0-4d8ca00ef946",
|
||||
"agent_id": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126",
|
||||
"command": null,
|
||||
"healthcheck": [
|
||||
{
|
||||
|
@ -66,19 +65,39 @@
|
|||
}
|
||||
],
|
||||
"icon": null,
|
||||
"id": "e4556c74-2f67-4266-b1e8-7ee61d754583",
|
||||
"id": "817c6904-69e1-485f-a057-4ddac83a9c5a",
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": true,
|
||||
"url": null
|
||||
},
|
||||
"sensitive_values": {
|
||||
"healthcheck": [
|
||||
{}
|
||||
]
|
||||
"healthcheck": [{}]
|
||||
},
|
||||
"depends_on": [
|
||||
"coder_agent.dev1"
|
||||
]
|
||||
"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": "ecf210c8-aaa7-4a14-9b44-2a5f805f0126",
|
||||
"command": null,
|
||||
"healthcheck": [],
|
||||
"icon": null,
|
||||
"id": "c4a502b3-cc82-4fdf-952b-4b429e711798",
|
||||
"name": null,
|
||||
"relative_path": null,
|
||||
"subdomain": false,
|
||||
"url": null
|
||||
},
|
||||
"sensitive_values": {
|
||||
"healthcheck": []
|
||||
},
|
||||
"depends_on": ["coder_agent.dev1"]
|
||||
},
|
||||
{
|
||||
"address": "null_resource.dev",
|
||||
|
@ -88,13 +107,11 @@
|
|||
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||
"schema_version": 0,
|
||||
"values": {
|
||||
"id": "2997000197756647168",
|
||||
"id": "1281108380136021489",
|
||||
"triggers": null
|
||||
},
|
||||
"sensitive_values": {},
|
||||
"depends_on": [
|
||||
"coder_agent.dev1"
|
||||
]
|
||||
"depends_on": ["coder_agent.dev1"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ terraform {
|
|||
required_providers {
|
||||
coder = {
|
||||
source = "coder/coder"
|
||||
version = "0.4.15"
|
||||
version = "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
41
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json
generated
vendored
41
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json
generated
vendored
|
@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
21
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json
generated
vendored
21
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json
generated
vendored
|
@ -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": {}
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -603,6 +603,7 @@ export interface WorkspaceApp {
|
|||
readonly name: string
|
||||
readonly command?: string
|
||||
readonly icon?: string
|
||||
readonly subdomain: boolean
|
||||
readonly healthcheck: Healthcheck
|
||||
readonly health: WorkspaceAppHealth
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ const Template: Story<AppLinkProps> = (args) => <AppLink {...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",
|
||||
|
|
|
@ -2,6 +2,7 @@ import Button from "@material-ui/core/Button"
|
|||
import CircularProgress from "@material-ui/core/CircularProgress"
|
||||
import Link from "@material-ui/core/Link"
|
||||
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"
|
||||
|
@ -13,68 +14,92 @@ export const Language = {
|
|||
}
|
||||
|
||||
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"]
|
||||
appSubdomain: TypesGen.WorkspaceApp["subdomain"]
|
||||
health: TypesGen.WorkspaceApp["health"]
|
||||
}
|
||||
|
||||
export const AppLink: FC<PropsWithChildren<AppLinkProps>> = ({
|
||||
userName,
|
||||
appsHost,
|
||||
username,
|
||||
workspaceName,
|
||||
agentName,
|
||||
appName,
|
||||
appIcon,
|
||||
appCommand,
|
||||
appSubdomain,
|
||||
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 && appSubdomain) {
|
||||
const subdomain = `${appName}--${agentName}--${workspaceName}--${username}`
|
||||
href = `${window.location.protocol}//${subdomain}.${appsHost}/`
|
||||
}
|
||||
|
||||
let canClick = true
|
||||
let icon = appIcon ? <img alt={`${appName} Icon`} src={appIcon} /> : <ComputerIcon />
|
||||
let tooltip = ""
|
||||
if (health === "initializing") {
|
||||
canClick = false
|
||||
icon = <CircularProgress size={16} />
|
||||
tooltip = "Initializing..."
|
||||
}
|
||||
if (health === "unhealthy") {
|
||||
canClick = false
|
||||
icon = <ErrorOutlineIcon className={styles.unhealthyIcon} />
|
||||
tooltip = "Unhealthy"
|
||||
}
|
||||
if (!appsHost && appSubdomain) {
|
||||
canClick = false
|
||||
icon = <ErrorOutlineIcon className={styles.notConfiguredIcon} />
|
||||
tooltip = "Your admin has not configured subdomain application access"
|
||||
}
|
||||
|
||||
const button = (
|
||||
<Button size="small" startIcon={icon} className={styles.button} disabled={!canClick}>
|
||||
{appName}
|
||||
</Button>
|
||||
)
|
||||
|
||||
return (
|
||||
<Link
|
||||
href={href}
|
||||
target="_blank"
|
||||
className={canClick ? styles.link : styles.disabledLink}
|
||||
onClick={
|
||||
canClick
|
||||
? (event) => {
|
||||
event.preventDefault()
|
||||
window.open(
|
||||
href,
|
||||
Language.appTitle(appName, generateRandomString(12)),
|
||||
"width=900,height=600",
|
||||
)
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Button size="small" startIcon={icon} className={styles.button} disabled={!canClick}>
|
||||
{appName}
|
||||
</Button>
|
||||
</Link>
|
||||
<Tooltip title={tooltip}>
|
||||
<span>
|
||||
<Link
|
||||
href={href}
|
||||
target="_blank"
|
||||
className={canClick ? styles.link : styles.disabledLink}
|
||||
onClick={
|
||||
canClick
|
||||
? (event) => {
|
||||
event.preventDefault()
|
||||
window.open(
|
||||
href,
|
||||
Language.appTitle(appName, generateRandomString(12)),
|
||||
"width=900,height=600",
|
||||
)
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{button}
|
||||
</Link>
|
||||
</span>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -95,4 +120,8 @@ const useStyles = makeStyles((theme) => ({
|
|||
unhealthyIcon: {
|
||||
color: theme.palette.warning.light,
|
||||
},
|
||||
|
||||
notConfiguredIcon: {
|
||||
color: theme.palette.grey[300],
|
||||
},
|
||||
}))
|
||||
|
|
|
@ -175,10 +175,12 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
|
|||
{agent.apps.map((app) => (
|
||||
<AppLink
|
||||
key={app.name}
|
||||
appsHost={applicationsHost}
|
||||
appIcon={app.icon}
|
||||
appName={app.name}
|
||||
appCommand={app.command}
|
||||
userName={workspace.owner_name}
|
||||
appSubdomain={app.subdomain}
|
||||
username={workspace.owner_name}
|
||||
workspaceName={workspace.name}
|
||||
agentName={agent.name}
|
||||
health={app.health}
|
||||
|
|
|
@ -193,6 +193,7 @@ export const MockWorkspaceApp: TypesGen.WorkspaceApp = {
|
|||
id: "test-app",
|
||||
name: "test-app",
|
||||
icon: "",
|
||||
subdomain: false,
|
||||
health: "disabled",
|
||||
healthcheck: {
|
||||
url: "",
|
||||
|
|
Loading…
Reference in New Issue