mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Allow hide resources (#3977)
This commit is contained in:
@ -1767,6 +1767,7 @@ func (q *fakeQuerier) InsertWorkspaceResource(_ context.Context, arg database.In
|
|||||||
Transition: arg.Transition,
|
Transition: arg.Transition,
|
||||||
Type: arg.Type,
|
Type: arg.Type,
|
||||||
Name: arg.Name,
|
Name: arg.Name,
|
||||||
|
Hide: arg.Hide,
|
||||||
}
|
}
|
||||||
q.provisionerJobResources = append(q.provisionerJobResources, resource)
|
q.provisionerJobResources = append(q.provisionerJobResources, resource)
|
||||||
return resource, nil
|
return resource, nil
|
||||||
|
3
coderd/database/dump.sql
generated
3
coderd/database/dump.sql
generated
@ -366,7 +366,8 @@ CREATE TABLE workspace_resources (
|
|||||||
job_id uuid NOT NULL,
|
job_id uuid NOT NULL,
|
||||||
transition workspace_transition NOT NULL,
|
transition workspace_transition NOT NULL,
|
||||||
type character varying(192) NOT NULL,
|
type character varying(192) NOT NULL,
|
||||||
name character varying(64) NOT NULL
|
name character varying(64) NOT NULL,
|
||||||
|
hide boolean DEFAULT false NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE workspaces (
|
CREATE TABLE workspaces (
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE workspace_resources
|
||||||
|
DROP COLUMN hide;
|
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE workspace_resources
|
||||||
|
ADD COLUMN hide boolean DEFAULT false NOT NULL;
|
@ -586,6 +586,7 @@ type WorkspaceResource struct {
|
|||||||
Transition WorkspaceTransition `db:"transition" json:"transition"`
|
Transition WorkspaceTransition `db:"transition" json:"transition"`
|
||||||
Type string `db:"type" json:"type"`
|
Type string `db:"type" json:"type"`
|
||||||
Name string `db:"name" json:"name"`
|
Name string `db:"name" json:"name"`
|
||||||
|
Hide bool `db:"hide" json:"hide"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type WorkspaceResourceMetadatum struct {
|
type WorkspaceResourceMetadatum struct {
|
||||||
|
@ -4320,7 +4320,7 @@ func (q *sqlQuerier) UpdateWorkspaceBuildByID(ctx context.Context, arg UpdateWor
|
|||||||
|
|
||||||
const getWorkspaceResourceByID = `-- name: GetWorkspaceResourceByID :one
|
const getWorkspaceResourceByID = `-- name: GetWorkspaceResourceByID :one
|
||||||
SELECT
|
SELECT
|
||||||
id, created_at, job_id, transition, type, name
|
id, created_at, job_id, transition, type, name, hide
|
||||||
FROM
|
FROM
|
||||||
workspace_resources
|
workspace_resources
|
||||||
WHERE
|
WHERE
|
||||||
@ -4337,6 +4337,7 @@ func (q *sqlQuerier) GetWorkspaceResourceByID(ctx context.Context, id uuid.UUID)
|
|||||||
&i.Transition,
|
&i.Transition,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
&i.Name,
|
&i.Name,
|
||||||
|
&i.Hide,
|
||||||
)
|
)
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
@ -4451,7 +4452,7 @@ func (q *sqlQuerier) GetWorkspaceResourceMetadataCreatedAfter(ctx context.Contex
|
|||||||
|
|
||||||
const getWorkspaceResourcesByJobID = `-- name: GetWorkspaceResourcesByJobID :many
|
const getWorkspaceResourcesByJobID = `-- name: GetWorkspaceResourcesByJobID :many
|
||||||
SELECT
|
SELECT
|
||||||
id, created_at, job_id, transition, type, name
|
id, created_at, job_id, transition, type, name, hide
|
||||||
FROM
|
FROM
|
||||||
workspace_resources
|
workspace_resources
|
||||||
WHERE
|
WHERE
|
||||||
@ -4474,6 +4475,7 @@ func (q *sqlQuerier) GetWorkspaceResourcesByJobID(ctx context.Context, jobID uui
|
|||||||
&i.Transition,
|
&i.Transition,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
&i.Name,
|
&i.Name,
|
||||||
|
&i.Hide,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -4489,7 +4491,7 @@ func (q *sqlQuerier) GetWorkspaceResourcesByJobID(ctx context.Context, jobID uui
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getWorkspaceResourcesCreatedAfter = `-- name: GetWorkspaceResourcesCreatedAfter :many
|
const getWorkspaceResourcesCreatedAfter = `-- name: GetWorkspaceResourcesCreatedAfter :many
|
||||||
SELECT id, created_at, job_id, transition, type, name FROM workspace_resources WHERE created_at > $1
|
SELECT id, created_at, job_id, transition, type, name, hide FROM workspace_resources WHERE created_at > $1
|
||||||
`
|
`
|
||||||
|
|
||||||
func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, createdAt time.Time) ([]WorkspaceResource, error) {
|
func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, createdAt time.Time) ([]WorkspaceResource, error) {
|
||||||
@ -4508,6 +4510,7 @@ func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, crea
|
|||||||
&i.Transition,
|
&i.Transition,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
&i.Name,
|
&i.Name,
|
||||||
|
&i.Hide,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -4524,9 +4527,9 @@ func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, crea
|
|||||||
|
|
||||||
const insertWorkspaceResource = `-- name: InsertWorkspaceResource :one
|
const insertWorkspaceResource = `-- name: InsertWorkspaceResource :one
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
workspace_resources (id, created_at, job_id, transition, type, name)
|
workspace_resources (id, created_at, job_id, transition, type, name, hide)
|
||||||
VALUES
|
VALUES
|
||||||
($1, $2, $3, $4, $5, $6) RETURNING id, created_at, job_id, transition, type, name
|
($1, $2, $3, $4, $5, $6, $7) RETURNING id, created_at, job_id, transition, type, name, hide
|
||||||
`
|
`
|
||||||
|
|
||||||
type InsertWorkspaceResourceParams struct {
|
type InsertWorkspaceResourceParams struct {
|
||||||
@ -4536,6 +4539,7 @@ type InsertWorkspaceResourceParams struct {
|
|||||||
Transition WorkspaceTransition `db:"transition" json:"transition"`
|
Transition WorkspaceTransition `db:"transition" json:"transition"`
|
||||||
Type string `db:"type" json:"type"`
|
Type string `db:"type" json:"type"`
|
||||||
Name string `db:"name" json:"name"`
|
Name string `db:"name" json:"name"`
|
||||||
|
Hide bool `db:"hide" json:"hide"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWorkspaceResourceParams) (WorkspaceResource, error) {
|
func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWorkspaceResourceParams) (WorkspaceResource, error) {
|
||||||
@ -4546,6 +4550,7 @@ func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWork
|
|||||||
arg.Transition,
|
arg.Transition,
|
||||||
arg.Type,
|
arg.Type,
|
||||||
arg.Name,
|
arg.Name,
|
||||||
|
arg.Hide,
|
||||||
)
|
)
|
||||||
var i WorkspaceResource
|
var i WorkspaceResource
|
||||||
err := row.Scan(
|
err := row.Scan(
|
||||||
@ -4555,6 +4560,7 @@ func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWork
|
|||||||
&i.Transition,
|
&i.Transition,
|
||||||
&i.Type,
|
&i.Type,
|
||||||
&i.Name,
|
&i.Name,
|
||||||
|
&i.Hide,
|
||||||
)
|
)
|
||||||
return i, err
|
return i, err
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ SELECT * FROM workspace_resources WHERE created_at > $1;
|
|||||||
|
|
||||||
-- name: InsertWorkspaceResource :one
|
-- name: InsertWorkspaceResource :one
|
||||||
INSERT INTO
|
INSERT INTO
|
||||||
workspace_resources (id, created_at, job_id, transition, type, name)
|
workspace_resources (id, created_at, job_id, transition, type, name, hide)
|
||||||
VALUES
|
VALUES
|
||||||
($1, $2, $3, $4, $5, $6) RETURNING *;
|
($1, $2, $3, $4, $5, $6, $7) RETURNING *;
|
||||||
|
|
||||||
-- name: GetWorkspaceResourceMetadataByResourceID :many
|
-- name: GetWorkspaceResourceMetadataByResourceID :many
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -752,6 +752,7 @@ func insertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
|
|||||||
Transition: transition,
|
Transition: transition,
|
||||||
Type: protoResource.Type,
|
Type: protoResource.Type,
|
||||||
Name: protoResource.Name,
|
Name: protoResource.Name,
|
||||||
|
Hide: protoResource.Hide,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("insert provisioner job resource %q: %w", protoResource.Name, err)
|
return xerrors.Errorf("insert provisioner job resource %q: %w", protoResource.Name, err)
|
||||||
|
@ -698,6 +698,7 @@ func convertWorkspaceResource(resource database.WorkspaceResource, agents []code
|
|||||||
Transition: codersdk.WorkspaceTransition(resource.Transition),
|
Transition: codersdk.WorkspaceTransition(resource.Transition),
|
||||||
Type: resource.Type,
|
Type: resource.Type,
|
||||||
Name: resource.Name,
|
Name: resource.Name,
|
||||||
|
Hide: resource.Hide,
|
||||||
Agents: agents,
|
Agents: agents,
|
||||||
Metadata: convertedMetadata,
|
Metadata: convertedMetadata,
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ type WorkspaceResource struct {
|
|||||||
Transition WorkspaceTransition `json:"workspace_transition"`
|
Transition WorkspaceTransition `json:"workspace_transition"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
Hide bool `json:"hide"`
|
||||||
Agents []WorkspaceAgent `json:"agents,omitempty"`
|
Agents []WorkspaceAgent `json:"agents,omitempty"`
|
||||||
Metadata []WorkspaceResourceMetadata `json:"metadata,omitempty"`
|
Metadata []WorkspaceResourceMetadata `json:"metadata,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ func TestProvision_Cancel(t *testing.T) {
|
|||||||
|
|
||||||
cwd, err := os.Getwd()
|
cwd, err := os.Getwd()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
fakeBin := filepath.Join(cwd, "testdata", "bin", "terraform_fake_cancel.sh")
|
fakeBin := filepath.Join(cwd, "testdata", "fake_cancel.sh")
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
@ -36,6 +36,7 @@ type agentAppAttributes struct {
|
|||||||
// A mapping of attributes on the "coder_metadata" resource.
|
// A mapping of attributes on the "coder_metadata" resource.
|
||||||
type metadataAttributes struct {
|
type metadataAttributes struct {
|
||||||
ResourceID string `mapstructure:"resource_id"`
|
ResourceID string `mapstructure:"resource_id"`
|
||||||
|
Hide bool `mapstructure:"hide"`
|
||||||
Items []metadataItem `mapstructure:"item"`
|
Items []metadataItem `mapstructure:"item"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ type metadataItem struct {
|
|||||||
|
|
||||||
// ConvertResources consumes Terraform state and a GraphViz representation produced by
|
// ConvertResources consumes Terraform state and a GraphViz representation produced by
|
||||||
// `terraform graph` to produce resources consumable by Coder.
|
// `terraform graph` to produce resources consumable by Coder.
|
||||||
|
// nolint:gocyclo
|
||||||
func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Resource, error) {
|
func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Resource, error) {
|
||||||
parsedGraph, err := gographviz.ParseString(rawGraph)
|
parsedGraph, err := gographviz.ParseString(rawGraph)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -137,7 +139,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
var agentResource *graphResource
|
var agentResource *graphResource
|
||||||
for _, resource := range findResourcesUpGraph(graph, tfResourceByLabel, agentNode.Name, 0) {
|
for _, resource := range findResourcesInGraph(graph, tfResourceByLabel, agentNode.Name, 0, true) {
|
||||||
if agentResource == nil {
|
if agentResource == nil {
|
||||||
// Default to the first resource because we have nothing to compare!
|
// Default to the first resource because we have nothing to compare!
|
||||||
agentResource = resource
|
agentResource = resource
|
||||||
@ -234,7 +236,8 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
|
|||||||
|
|
||||||
// Associate metadata blocks with resources.
|
// Associate metadata blocks with resources.
|
||||||
resourceMetadata := map[string][]*proto.Resource_Metadata{}
|
resourceMetadata := map[string][]*proto.Resource_Metadata{}
|
||||||
for label, resource := range tfResourceByLabel {
|
resourceHidden := map[string]bool{}
|
||||||
|
for _, resource := range tfResourceByLabel {
|
||||||
if resource.Type != "coder_metadata" {
|
if resource.Type != "coder_metadata" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -244,17 +247,54 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
|
|||||||
return nil, xerrors.Errorf("decode metadata attributes: %w", err)
|
return nil, xerrors.Errorf("decode metadata attributes: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var targetLabel string
|
||||||
|
// This occurs in a plan, because there is no resource ID.
|
||||||
|
// We attempt to find the closest node, just so we can hide it from the UI.
|
||||||
if attrs.ResourceID == "" {
|
if attrs.ResourceID == "" {
|
||||||
// TODO: detect this as an error
|
resourceLabel := convertAddressToLabel(resource.Address)
|
||||||
// At plan time, change.after_unknown.resource_id should be "true".
|
|
||||||
// At provision time, values.resource_id should be set.
|
var attachedNode *gographviz.Node
|
||||||
|
for _, node := range graph.Nodes.Lookup {
|
||||||
|
// The node attributes surround the label with quotes.
|
||||||
|
if strings.Trim(node.Attrs["label"], `"`) != resourceLabel {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
attachedNode = node
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if attachedNode == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var attachedResource *graphResource
|
||||||
|
for _, resource := range findResourcesInGraph(graph, tfResourceByLabel, attachedNode.Name, 0, false) {
|
||||||
|
if attachedResource == nil {
|
||||||
|
// Default to the first resource because we have nothing to compare!
|
||||||
|
attachedResource = resource
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if resource.Depth < attachedResource.Depth {
|
||||||
|
// There's a closer resource!
|
||||||
|
attachedResource = resource
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if resource.Depth == attachedResource.Depth && resource.Label < attachedResource.Label {
|
||||||
|
attachedResource = resource
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if attachedResource == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
targetLabel = attachedResource.Label
|
||||||
|
}
|
||||||
|
if targetLabel == "" {
|
||||||
|
targetLabel = resourceLabelByID[attrs.ResourceID]
|
||||||
|
}
|
||||||
|
if targetLabel == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
targetLabel, ok := resourceLabelByID[attrs.ResourceID]
|
|
||||||
if !ok {
|
|
||||||
return nil, xerrors.Errorf("attribute %s.resource_id = %q does not refer to a valid resource", label, attrs.ResourceID)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
resourceHidden[targetLabel] = attrs.Hide
|
||||||
for _, item := range attrs.Items {
|
for _, item := range attrs.Items {
|
||||||
resourceMetadata[targetLabel] = append(resourceMetadata[targetLabel],
|
resourceMetadata[targetLabel] = append(resourceMetadata[targetLabel],
|
||||||
&proto.Resource_Metadata{
|
&proto.Resource_Metadata{
|
||||||
@ -284,6 +324,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
|
|||||||
Name: resource.Name,
|
Name: resource.Name,
|
||||||
Type: resource.Type,
|
Type: resource.Type,
|
||||||
Agents: agents,
|
Agents: agents,
|
||||||
|
Hide: resourceHidden[label],
|
||||||
Metadata: resourceMetadata[label],
|
Metadata: resourceMetadata[label],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -344,14 +385,19 @@ func applyAutomaticInstanceID(resource *tfjson.StateResource, agents []*proto.Ag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// findResourcesUpGraph traverses upwards in a graph until a resource is found,
|
// findResourcesInGraph traverses directionally in a graph until a resource is found,
|
||||||
// then it stores the depth it was found at, and continues working up the tree.
|
// then it stores the depth it was found at, and continues working up the tree.
|
||||||
func findResourcesUpGraph(graph *gographviz.Graph, tfResourceByLabel map[string]*tfjson.StateResource, nodeName string, currentDepth uint) []*graphResource {
|
// nolint:revive
|
||||||
|
func findResourcesInGraph(graph *gographviz.Graph, tfResourceByLabel map[string]*tfjson.StateResource, nodeName string, currentDepth uint, up bool) []*graphResource {
|
||||||
graphResources := make([]*graphResource, 0)
|
graphResources := make([]*graphResource, 0)
|
||||||
for destination := range graph.Edges.DstToSrcs[nodeName] {
|
mapping := graph.Edges.DstToSrcs
|
||||||
|
if !up {
|
||||||
|
mapping = graph.Edges.SrcToDsts
|
||||||
|
}
|
||||||
|
for destination := range mapping[nodeName] {
|
||||||
destinationNode := graph.Nodes.Lookup[destination]
|
destinationNode := graph.Nodes.Lookup[destination]
|
||||||
// Work our way up the tree!
|
// Work our way up the tree!
|
||||||
graphResources = append(graphResources, findResourcesUpGraph(graph, tfResourceByLabel, destinationNode.Name, currentDepth+1)...)
|
graphResources = append(graphResources, findResourcesInGraph(graph, tfResourceByLabel, destinationNode.Name, currentDepth+1, up)...)
|
||||||
|
|
||||||
destinationLabel, exists := destinationNode.Attrs["label"]
|
destinationLabel, exists := destinationNode.Attrs["label"]
|
||||||
if !exists {
|
if !exists {
|
||||||
|
@ -120,6 +120,7 @@ func TestConvertResources(t *testing.T) {
|
|||||||
"resource-metadata": {{
|
"resource-metadata": {{
|
||||||
Name: "about",
|
Name: "about",
|
||||||
Type: "null_resource",
|
Type: "null_resource",
|
||||||
|
Hide: true,
|
||||||
Metadata: []*proto.Resource_Metadata{{
|
Metadata: []*proto.Resource_Metadata{{
|
||||||
Key: "hello",
|
Key: "hello",
|
||||||
Value: "world",
|
Value: "world",
|
||||||
@ -155,11 +156,13 @@ func TestConvertResources(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
sortResources(resources)
|
sortResources(resources)
|
||||||
|
|
||||||
// plan does not contain metadata, so clone expected and remove it
|
|
||||||
var expectedNoMetadata []*proto.Resource
|
var expectedNoMetadata []*proto.Resource
|
||||||
for _, resource := range expected {
|
for _, resource := range expected {
|
||||||
resourceCopy, _ := protobuf.Clone(resource).(*proto.Resource)
|
resourceCopy, _ := protobuf.Clone(resource).(*proto.Resource)
|
||||||
resourceCopy.Metadata = nil
|
// plan cannot know whether values are null or not
|
||||||
|
for _, metadata := range resourceCopy.Metadata {
|
||||||
|
metadata.IsNull = false
|
||||||
|
}
|
||||||
expectedNoMetadata = append(expectedNoMetadata, resourceCopy)
|
expectedNoMetadata = append(expectedNoMetadata, resourceCopy)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.2"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
provisioner/terraform/testdata/calling-module/calling-module.tfplan.json
generated
vendored
4
provisioner/terraform/testdata/calling-module/calling-module.tfplan.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -147,7 +147,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.2"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"module.module:null": {
|
"module.module:null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
|
10
provisioner/terraform/testdata/calling-module/calling-module.tfstate.json
generated
vendored
10
provisioner/terraform/testdata/calling-module/calling-module.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "78098841-3d6c-4aa7-9d3c-6e4c9be7e2df",
|
"id": "ee0b689a-9785-4d72-923f-e2acf88d709b",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "605d8d2c-a720-4422-9410-62b41e3e6565"
|
"token": "a295c68a-27af-4dc8-92cd-db154084cf30"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@
|
|||||||
"outputs": {
|
"outputs": {
|
||||||
"script": ""
|
"script": ""
|
||||||
},
|
},
|
||||||
"random": "3340396623875729305"
|
"random": "410687191584620713"
|
||||||
},
|
},
|
||||||
"sensitive_values": {
|
"sensitive_values": {
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
@ -59,7 +59,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "831556400374221454",
|
"id": "7780508472225873711",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.2"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json
generated
vendored
4
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfplan.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -125,7 +125,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.2"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"null": {
|
"null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
|
10
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json
generated
vendored
10
provisioner/terraform/testdata/chaining-resources/chaining-resources.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "79e7cbba-c238-47f1-aec2-eb816385595d",
|
"id": "97baf22d-c3fc-4570-a025-58dd5235366f",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "96cc0f63-c65b-4fea-90bb-073e57ddc766"
|
"token": "ae325f47-8fe4-436c-9787-7295eef26604"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "6159719504309004303",
|
"id": "8957171845319631256",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "5246585857846899839",
|
"id": "7521770950111838137",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.2"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -125,7 +125,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.2"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"null": {
|
"null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
|
10
provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json
generated
vendored
10
provisioner/terraform/testdata/conflicting-resources/conflicting-resources.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "1c27d2eb-c2e3-4391-b3a2-5e3f57ae9ec6",
|
"id": "75c43b92-2812-4a6b-9a40-16c124c3c2ff",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "c0dbedc7-fb3d-4b77-a3f8-6c84c688db57"
|
"token": "bf14e82d-7e8f-49b5-8e2a-fb84da4b6afa"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "2210256189362430895",
|
"id": "5082348601033637104",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
@ -48,7 +48,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "7017926349421667565",
|
"id": "135765900644760615",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
|
2
provisioner/terraform/testdata/generate.sh
vendored
2
provisioner/terraform/testdata/generate.sh
vendored
@ -6,7 +6,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
|
|||||||
for d in */; do
|
for d in */; do
|
||||||
pushd "$d"
|
pushd "$d"
|
||||||
name=$(basename "$(pwd)")
|
name=$(basename "$(pwd)")
|
||||||
terraform init
|
terraform init -upgrade
|
||||||
terraform plan -out terraform.tfplan
|
terraform plan -out terraform.tfplan
|
||||||
terraform show -json ./terraform.tfplan | jq >"$name".tfplan.json
|
terraform show -json ./terraform.tfplan | jq >"$name".tfplan.json
|
||||||
terraform graph >"$name".tfplan.dot
|
terraform graph >"$name".tfplan.dot
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.2"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
provisioner/terraform/testdata/instance-id/instance-id.tfplan.json
generated
vendored
4
provisioner/terraform/testdata/instance-id/instance-id.tfplan.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -126,7 +126,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.2"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"null": {
|
"null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
|
12
provisioner/terraform/testdata/instance-id/instance-id.tfstate.json
generated
vendored
12
provisioner/terraform/testdata/instance-id/instance-id.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "google-instance-identity",
|
"auth": "google-instance-identity",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "0c214e55-a886-4b2b-a3b5-a3eaf55be2f4",
|
"id": "9112719f-1e11-41d0-8baf-7f92e94fb510",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "afeac870-ff84-4bd9-952b-0325f8e4266a"
|
"token": "8d556c96-9010-4ae9-8993-69c01de97d24"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -32,8 +32,8 @@
|
|||||||
"provider_name": "registry.terraform.io/coder/coder",
|
"provider_name": "registry.terraform.io/coder/coder",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"agent_id": "0c214e55-a886-4b2b-a3b5-a3eaf55be2f4",
|
"agent_id": "9112719f-1e11-41d0-8baf-7f92e94fb510",
|
||||||
"id": "e48f98eb-6d1a-4fe9-8526-3ad92ac54dc9",
|
"id": "35efb5bc-da00-45e8-b38c-df4899417842",
|
||||||
"instance_id": "example"
|
"instance_id": "example"
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "565648463520883027",
|
"id": "6105197068461821872",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.2"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json
generated
vendored
4
provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -182,7 +182,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.2"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"null": {
|
"null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
|
16
provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json
generated
vendored
16
provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "7a5de656-7e69-4cb2-9ae1-8bed34e62f13",
|
"id": "0a714220-de27-4721-a6ab-d5c21c8e99b8",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "03d9d621-c589-4b89-8bc1-07acb60c4c4d"
|
"token": "d241aebd-6d75-4c06-a02e-74b41607345c"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -36,11 +36,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "8dadb875-f4af-4827-b701-5e22815cbd72",
|
"id": "27567c6b-c52a-4c01-a6ad-368fddb36c9a",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "darwin",
|
"os": "darwin",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "b431714b-b2e9-45d7-969f-bf93f5cc0dab"
|
"token": "eb5f4e5e-eb57-434c-a444-274b811afa30"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -56,11 +56,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "7947e78a-70b6-4fed-aa0e-5b262cf531dc",
|
"id": "b689c633-e666-43e1-ac77-9522f187a098",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "windows",
|
"os": "windows",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "93b837fb-0676-4d52-a343-b6668adeb733"
|
"token": "90a9c42e-df1f-4656-ac4c-c7f4ab06a269"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -72,7 +72,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "2338175068284005953",
|
"id": "7866048965316331550",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.2"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json
generated
vendored
4
provisioner/terraform/testdata/multiple-apps/multiple-apps.tfplan.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -176,7 +176,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.2"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"null": {
|
"null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
|
16
provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json
generated
vendored
16
provisioner/terraform/testdata/multiple-apps/multiple-apps.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.5",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "7ad4fa50-dc01-49dc-ac83-8ad5740aa0cb",
|
"id": "04d74496-49a6-4757-b1b2-47e21840067e",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "eafde061-9020-409c-b258-bde0a8d05075"
|
"token": "1417b29e-da8c-45fb-998d-fbec32069e8d"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -32,10 +32,10 @@
|
|||||||
"provider_name": "registry.terraform.io/coder/coder",
|
"provider_name": "registry.terraform.io/coder/coder",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"agent_id": "7ad4fa50-dc01-49dc-ac83-8ad5740aa0cb",
|
"agent_id": "04d74496-49a6-4757-b1b2-47e21840067e",
|
||||||
"command": null,
|
"command": null,
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"id": "9cea1631-c146-4996-9e29-7977cfe62a23",
|
"id": "0a5869ef-00d9-4a37-9f72-e0b2bf0d266b",
|
||||||
"name": null,
|
"name": null,
|
||||||
"relative_path": null,
|
"relative_path": null,
|
||||||
"url": null
|
"url": null
|
||||||
@ -53,10 +53,10 @@
|
|||||||
"provider_name": "registry.terraform.io/coder/coder",
|
"provider_name": "registry.terraform.io/coder/coder",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"agent_id": "7ad4fa50-dc01-49dc-ac83-8ad5740aa0cb",
|
"agent_id": "04d74496-49a6-4757-b1b2-47e21840067e",
|
||||||
"command": null,
|
"command": null,
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"id": "4d9b0721-3630-4807-b3f6-0114a9ccd938",
|
"id": "d525e0c1-b494-4911-8b17-8cfb2d248fbf",
|
||||||
"name": null,
|
"name": null,
|
||||||
"relative_path": null,
|
"relative_path": null,
|
||||||
"url": null
|
"url": null
|
||||||
@ -74,7 +74,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "4241115483797204647",
|
"id": "5711218402680555438",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {},
|
"sensitive_values": {},
|
||||||
|
@ -2,7 +2,7 @@ terraform {
|
|||||||
required_providers {
|
required_providers {
|
||||||
coder = {
|
coder = {
|
||||||
source = "coder/coder"
|
source = "coder/coder"
|
||||||
version = "0.4.4"
|
version = "0.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -16,6 +16,7 @@ resource "null_resource" "about" {}
|
|||||||
|
|
||||||
resource "coder_metadata" "about_info" {
|
resource "coder_metadata" "about_info" {
|
||||||
resource_id = null_resource.about.id
|
resource_id = null_resource.about.id
|
||||||
|
hide = true
|
||||||
item {
|
item {
|
||||||
key = "hello"
|
key = "hello"
|
||||||
value = "world"
|
value = "world"
|
||||||
|
9
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json
generated
vendored
9
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfplan.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.1",
|
"format_version": "1.1",
|
||||||
"terraform_version": "1.2.6",
|
"terraform_version": "1.2.8",
|
||||||
"planned_values": {
|
"planned_values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -29,6 +29,7 @@
|
|||||||
"provider_name": "registry.terraform.io/coder/coder",
|
"provider_name": "registry.terraform.io/coder/coder",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
|
"hide": true,
|
||||||
"item": [
|
"item": [
|
||||||
{
|
{
|
||||||
"key": "hello",
|
"key": "hello",
|
||||||
@ -117,6 +118,7 @@
|
|||||||
],
|
],
|
||||||
"before": null,
|
"before": null,
|
||||||
"after": {
|
"after": {
|
||||||
|
"hide": true,
|
||||||
"item": [
|
"item": [
|
||||||
{
|
{
|
||||||
"key": "hello",
|
"key": "hello",
|
||||||
@ -196,7 +198,7 @@
|
|||||||
"coder": {
|
"coder": {
|
||||||
"name": "coder",
|
"name": "coder",
|
||||||
"full_name": "registry.terraform.io/coder/coder",
|
"full_name": "registry.terraform.io/coder/coder",
|
||||||
"version_constraint": "0.4.4"
|
"version_constraint": "0.4.10"
|
||||||
},
|
},
|
||||||
"null": {
|
"null": {
|
||||||
"name": "null",
|
"name": "null",
|
||||||
@ -228,6 +230,9 @@
|
|||||||
"name": "about_info",
|
"name": "about_info",
|
||||||
"provider_config_key": "coder",
|
"provider_config_key": "coder",
|
||||||
"expressions": {
|
"expressions": {
|
||||||
|
"hide": {
|
||||||
|
"constant_value": true
|
||||||
|
},
|
||||||
"item": [
|
"item": [
|
||||||
{
|
{
|
||||||
"key": {
|
"key": {
|
||||||
|
13
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json
generated
vendored
13
provisioner/terraform/testdata/resource-metadata/resource-metadata.tfstate.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.0",
|
"format_version": "1.0",
|
||||||
"terraform_version": "1.2.6",
|
"terraform_version": "1.2.8",
|
||||||
"values": {
|
"values": {
|
||||||
"root_module": {
|
"root_module": {
|
||||||
"resources": [
|
"resources": [
|
||||||
@ -16,11 +16,11 @@
|
|||||||
"auth": "token",
|
"auth": "token",
|
||||||
"dir": null,
|
"dir": null,
|
||||||
"env": null,
|
"env": null,
|
||||||
"id": "33d1fa51-2987-43da-8f07-53131af520f2",
|
"id": "bf761056-4c83-4f36-98e9-fb15c4f3818f",
|
||||||
"init_script": "",
|
"init_script": "",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"startup_script": null,
|
"startup_script": null,
|
||||||
"token": "5acee40a-6f4f-4e38-92a8-98b057d4945f"
|
"token": "fcc945d1-ad27-47e5-9c31-aeb4ffd2dd67"
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
},
|
},
|
||||||
@ -32,7 +32,8 @@
|
|||||||
"provider_name": "registry.terraform.io/coder/coder",
|
"provider_name": "registry.terraform.io/coder/coder",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "5b828eb0-938f-4fba-8599-701dce975627",
|
"hide": true,
|
||||||
|
"id": "6f981e35-73a3-4478-8227-fed4643afd71",
|
||||||
"item": [
|
"item": [
|
||||||
{
|
{
|
||||||
"is_null": false,
|
"is_null": false,
|
||||||
@ -59,7 +60,7 @@
|
|||||||
"value": "squirrel"
|
"value": "squirrel"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"resource_id": "6511007151682544728"
|
"resource_id": "3184975245680216434"
|
||||||
},
|
},
|
||||||
"sensitive_values": {
|
"sensitive_values": {
|
||||||
"item": [
|
"item": [
|
||||||
@ -81,7 +82,7 @@
|
|||||||
"provider_name": "registry.terraform.io/hashicorp/null",
|
"provider_name": "registry.terraform.io/hashicorp/null",
|
||||||
"schema_version": 0,
|
"schema_version": 0,
|
||||||
"values": {
|
"values": {
|
||||||
"id": "6511007151682544728",
|
"id": "3184975245680216434",
|
||||||
"triggers": null
|
"triggers": null
|
||||||
},
|
},
|
||||||
"sensitive_values": {}
|
"sensitive_values": {}
|
||||||
|
216
provisionersdk/proto/provisioner.pb.go
generated
216
provisionersdk/proto/provisioner.pb.go
generated
@ -934,6 +934,7 @@ type Resource struct {
|
|||||||
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
||||||
Agents []*Agent `protobuf:"bytes,3,rep,name=agents,proto3" json:"agents,omitempty"`
|
Agents []*Agent `protobuf:"bytes,3,rep,name=agents,proto3" json:"agents,omitempty"`
|
||||||
Metadata []*Resource_Metadata `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty"`
|
Metadata []*Resource_Metadata `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty"`
|
||||||
|
Hide bool `protobuf:"varint,5,opt,name=hide,proto3" json:"hide,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Resource) Reset() {
|
func (x *Resource) Reset() {
|
||||||
@ -996,6 +997,13 @@ func (x *Resource) GetMetadata() []*Resource_Metadata {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Resource) GetHide() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Hide
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// Parse consumes source-code from a directory to produce inputs.
|
// Parse consumes source-code from a directory to produce inputs.
|
||||||
type Parse struct {
|
type Parse struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -1872,7 +1880,7 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{
|
|||||||
0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20,
|
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,
|
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,
|
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, 0x22, 0x85,
|
0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0x99,
|
||||||
0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e,
|
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,
|
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,
|
0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
|
||||||
@ -1882,110 +1890,112 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{
|
|||||||
0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28,
|
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,
|
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,
|
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, 0x1a, 0x69, 0x0a, 0x08, 0x4d,
|
0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x68,
|
||||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x68, 0x69, 0x64, 0x65, 0x1a,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
0x69, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
||||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12,
|
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
|
||||||
0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01,
|
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61,
|
||||||
0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, 0x17, 0x0a,
|
0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65,
|
||||||
0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76,
|
||||||
0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0xfc, 0x01, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65,
|
0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x1a, 0x27, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x64,
|
0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0xfc, 0x01, 0x0a, 0x05, 0x50,
|
||||||
0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
0x61, 0x72, 0x73, 0x65, 0x1a, 0x27, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x1a, 0x55, 0x0a, 0x08, 0x43, 0x6f, 0x6d,
|
0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
|
0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x1a, 0x55, 0x0a,
|
||||||
0x65, 0x72, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
|
0x08, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x49, 0x0a, 0x11, 0x70, 0x61, 0x72,
|
||||||
0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50,
|
0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x02,
|
||||||
0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x10,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73,
|
0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x63, 0x68, 0x65,
|
||||||
0x1a, 0x73, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03,
|
0x6d, 0x61, 0x52, 0x10, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x63, 0x68,
|
||||||
0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76,
|
0x65, 0x6d, 0x61, 0x73, 0x1a, 0x73, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c,
|
0x12, 0x24, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e,
|
||||||
0x6f, 0x67, 0x12, 0x39, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02,
|
0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
|
0x00, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x39, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
|
||||||
0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
|
0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69,
|
||||||
0x65, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x06, 0x0a,
|
0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d,
|
||||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xae, 0x07, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73,
|
0x70, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,
|
||||||
0x69, 0x6f, 0x6e, 0x1a, 0xd1, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
|
0x65, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xae, 0x07, 0x0a, 0x09, 0x50, 0x72,
|
||||||
0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20,
|
0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xd1, 0x02, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x53, 0x0a,
|
0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x5f, 0x75, 0x72,
|
||||||
0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x55, 0x72,
|
||||||
0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x70, 0x72,
|
0x6c, 0x12, 0x53, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74,
|
||||||
0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70,
|
0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
||||||
0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x77,
|
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, 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, 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,
|
0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b,
|
0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52,
|
||||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72,
|
0x4f, 0x59, 0x10, 0x02, 0x32, 0xa3, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69,
|
||||||
0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01,
|
0x6f, 0x6e, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12, 0x1a, 0x2e,
|
||||||
0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e,
|
0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73,
|
||||||
0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f,
|
0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76,
|
||||||
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, 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,
|
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,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76,
|
||||||
0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f,
|
||||||
0x73, 0x65, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f,
|
0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65,
|
||||||
0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f,
|
||||||
0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65,
|
||||||
0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e,
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69,
|
||||||
0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63,
|
||||||
0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
0x6f, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72,
|
||||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72,
|
0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x6b, 0x2f,
|
0x33,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -109,6 +109,7 @@ message Resource {
|
|||||||
bool is_null = 4;
|
bool is_null = 4;
|
||||||
}
|
}
|
||||||
repeated Metadata metadata = 4;
|
repeated Metadata metadata = 4;
|
||||||
|
bool hide = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse consumes source-code from a directory to produce inputs.
|
// Parse consumes source-code from a directory to produce inputs.
|
||||||
|
@ -636,6 +636,7 @@ export interface WorkspaceResource {
|
|||||||
readonly workspace_transition: WorkspaceTransition
|
readonly workspace_transition: WorkspaceTransition
|
||||||
readonly type: string
|
readonly type: string
|
||||||
readonly name: string
|
readonly name: string
|
||||||
|
readonly hide: boolean
|
||||||
readonly agents?: WorkspaceAgent[]
|
readonly agents?: WorkspaceAgent[]
|
||||||
readonly metadata?: WorkspaceResourceMetadata[]
|
readonly metadata?: WorkspaceResourceMetadata[]
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
import { screen } from "@testing-library/react"
|
|
||||||
import {
|
|
||||||
MockStoppedWorkspace,
|
|
||||||
MockWorkspaceResource,
|
|
||||||
MockWorkspaceResource2,
|
|
||||||
} from "testHelpers/entities"
|
|
||||||
import { render } from "testHelpers/renderHelpers"
|
|
||||||
import { DisplayAgentStatusLanguage } from "util/workspace"
|
|
||||||
import { Resources } from "./Resources"
|
|
||||||
|
|
||||||
describe("ResourceTable", () => {
|
|
||||||
it("hides status text when a workspace is stopped", async () => {
|
|
||||||
// When
|
|
||||||
const props = {
|
|
||||||
resource: [{ ...MockWorkspaceResource }, { ...MockWorkspaceResource2 }],
|
|
||||||
workspace: { ...MockStoppedWorkspace },
|
|
||||||
canUpdateWorkspace: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
render(<Resources {...props} />)
|
|
||||||
|
|
||||||
const statusText = screen.queryByText(DisplayAgentStatusLanguage.connecting)
|
|
||||||
|
|
||||||
// Then
|
|
||||||
expect(statusText).toBeNull()
|
|
||||||
})
|
|
||||||
})
|
|
@ -1,3 +1,4 @@
|
|||||||
|
import Button from "@material-ui/core/Button"
|
||||||
import { makeStyles, Theme } from "@material-ui/core/styles"
|
import { makeStyles, Theme } from "@material-ui/core/styles"
|
||||||
import Table from "@material-ui/core/Table"
|
import Table from "@material-ui/core/Table"
|
||||||
import TableBody from "@material-ui/core/TableBody"
|
import TableBody from "@material-ui/core/TableBody"
|
||||||
@ -7,9 +8,10 @@ import TableHead from "@material-ui/core/TableHead"
|
|||||||
import TableRow from "@material-ui/core/TableRow"
|
import TableRow from "@material-ui/core/TableRow"
|
||||||
import { Skeleton } from "@material-ui/lab"
|
import { Skeleton } from "@material-ui/lab"
|
||||||
import useTheme from "@material-ui/styles/useTheme"
|
import useTheme from "@material-ui/styles/useTheme"
|
||||||
|
import { CloseDropdown, OpenDropdown } from "components/DropdownArrows/DropdownArrows"
|
||||||
import { ErrorSummary } from "components/ErrorSummary/ErrorSummary"
|
import { ErrorSummary } from "components/ErrorSummary/ErrorSummary"
|
||||||
import { TableCellDataPrimary } from "components/TableCellData/TableCellData"
|
import { TableCellDataPrimary } from "components/TableCellData/TableCellData"
|
||||||
import { FC } from "react"
|
import { FC, useState } from "react"
|
||||||
import { getDisplayAgentStatus, getDisplayVersionStatus } from "util/workspace"
|
import { getDisplayAgentStatus, getDisplayVersionStatus } from "util/workspace"
|
||||||
import { BuildInfoResponse, Workspace, WorkspaceResource } from "../../api/typesGenerated"
|
import { BuildInfoResponse, Workspace, WorkspaceResource } from "../../api/typesGenerated"
|
||||||
import { AppLink } from "../AppLink/AppLink"
|
import { AppLink } from "../AppLink/AppLink"
|
||||||
@ -34,7 +36,7 @@ const Language = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface ResourcesProps {
|
interface ResourcesProps {
|
||||||
resources?: WorkspaceResource[]
|
resources: WorkspaceResource[]
|
||||||
getResourcesError?: Error | unknown
|
getResourcesError?: Error | unknown
|
||||||
workspace: Workspace
|
workspace: Workspace
|
||||||
canUpdateWorkspace: boolean
|
canUpdateWorkspace: boolean
|
||||||
@ -51,129 +53,159 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
|
|||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
const theme: Theme = useTheme()
|
const theme: Theme = useTheme()
|
||||||
const serverVersion = buildInfo?.version || ""
|
const serverVersion = buildInfo?.version || ""
|
||||||
|
const [shouldDisplayHideResources, setShouldDisplayHideResources] = useState(false)
|
||||||
|
const displayResources = shouldDisplayHideResources
|
||||||
|
? resources
|
||||||
|
: resources.filter((resource) => !resource.hide)
|
||||||
|
const hasHideResources = resources.some((r) => r.hide)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div aria-label={Language.resources} className={styles.wrapper}>
|
<Stack direction="column" spacing={1}>
|
||||||
{getResourcesError ? (
|
<div aria-label={Language.resources} className={styles.wrapper}>
|
||||||
<ErrorSummary error={getResourcesError} />
|
{getResourcesError ? (
|
||||||
) : (
|
<ErrorSummary error={getResourcesError} />
|
||||||
<TableContainer className={styles.tableContainer}>
|
) : (
|
||||||
<Table>
|
<TableContainer className={styles.tableContainer}>
|
||||||
<TableHead>
|
<Table>
|
||||||
<TableHeaderRow>
|
<TableHead>
|
||||||
<TableCell>
|
<TableHeaderRow>
|
||||||
<Stack direction="row" spacing={0.5} alignItems="center">
|
<TableCell>
|
||||||
{Language.resourceLabel}
|
<Stack direction="row" spacing={0.5} alignItems="center">
|
||||||
<ResourcesHelpTooltip />
|
{Language.resourceLabel}
|
||||||
</Stack>
|
<ResourcesHelpTooltip />
|
||||||
</TableCell>
|
</Stack>
|
||||||
<TableCell className={styles.agentColumn}>
|
</TableCell>
|
||||||
<Stack direction="row" spacing={0.5} alignItems="center">
|
<TableCell className={styles.agentColumn}>
|
||||||
{Language.agentLabel}
|
<Stack direction="row" spacing={0.5} alignItems="center">
|
||||||
<AgentHelpTooltip />
|
{Language.agentLabel}
|
||||||
</Stack>
|
<AgentHelpTooltip />
|
||||||
</TableCell>
|
</Stack>
|
||||||
{canUpdateWorkspace && <TableCell></TableCell>}
|
</TableCell>
|
||||||
</TableHeaderRow>
|
{canUpdateWorkspace && <TableCell></TableCell>}
|
||||||
</TableHead>
|
</TableHeaderRow>
|
||||||
<TableBody>
|
</TableHead>
|
||||||
{resources?.map((resource) => {
|
<TableBody>
|
||||||
{
|
{displayResources.map((resource) => {
|
||||||
/* We need to initialize the agents to display the resource */
|
|
||||||
}
|
|
||||||
const agents = resource.agents ?? [null]
|
|
||||||
const resourceName = <ResourceAvatarData resource={resource} />
|
|
||||||
|
|
||||||
return agents.map((agent, agentIndex) => {
|
|
||||||
{
|
{
|
||||||
/* If there is no agent, just display the resource name */
|
/* We need to initialize the agents to display the resource */
|
||||||
}
|
}
|
||||||
if (!agent) {
|
const agents = resource.agents ?? [null]
|
||||||
return (
|
const resourceName = <ResourceAvatarData resource={resource} />
|
||||||
<TableRow key={`${resource.id}-${agentIndex}`}>
|
|
||||||
<TableCell>{resourceName}</TableCell>
|
return agents.map((agent, agentIndex) => {
|
||||||
<TableCell colSpan={3}></TableCell>
|
{
|
||||||
</TableRow>
|
/* If there is no agent, just display the resource name */
|
||||||
|
}
|
||||||
|
if (!agent) {
|
||||||
|
return (
|
||||||
|
<TableRow key={`${resource.id}-${agentIndex}`}>
|
||||||
|
<TableCell>{resourceName}</TableCell>
|
||||||
|
<TableCell colSpan={3}></TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const { displayVersion, outdated } = getDisplayVersionStatus(
|
||||||
|
agent.version,
|
||||||
|
serverVersion,
|
||||||
)
|
)
|
||||||
}
|
const agentStatus = getDisplayAgentStatus(theme, agent)
|
||||||
|
return (
|
||||||
|
<TableRow key={`${resource.id}-${agent.id}`}>
|
||||||
|
{/* We only want to display the name in the first row because we are using rowSpan */}
|
||||||
|
{/* The rowspan should be the same than the number of agents */}
|
||||||
|
{agentIndex === 0 && (
|
||||||
|
<TableCell className={styles.resourceNameCell} rowSpan={agents.length}>
|
||||||
|
{resourceName}
|
||||||
|
</TableCell>
|
||||||
|
)}
|
||||||
|
|
||||||
const { displayVersion, outdated } = getDisplayVersionStatus(
|
<TableCell className={styles.agentColumn}>
|
||||||
agent.version,
|
<TableCellDataPrimary highlight>{agent.name}</TableCellDataPrimary>
|
||||||
serverVersion,
|
<div className={styles.data}>
|
||||||
)
|
<div className={styles.dataRow}>
|
||||||
const agentStatus = getDisplayAgentStatus(theme, agent)
|
<strong>{Language.statusLabel}</strong>
|
||||||
return (
|
<span style={{ color: agentStatus.color }} className={styles.status}>
|
||||||
<TableRow key={`${resource.id}-${agent.id}`}>
|
{agentStatus.status}
|
||||||
{/* We only want to display the name in the first row because we are using rowSpan */}
|
</span>
|
||||||
{/* The rowspan should be the same than the number of agents */}
|
</div>
|
||||||
{agentIndex === 0 && (
|
<div className={styles.dataRow}>
|
||||||
<TableCell className={styles.resourceNameCell} rowSpan={agents.length}>
|
<strong>{Language.osLabel}</strong>
|
||||||
{resourceName}
|
<span className={styles.operatingSystem}>
|
||||||
|
{agent.operating_system}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className={styles.dataRow}>
|
||||||
|
<strong>{Language.versionLabel}</strong>
|
||||||
|
<span className={styles.agentVersion}>{displayVersion}</span>
|
||||||
|
<AgentOutdatedTooltip outdated={outdated} />
|
||||||
|
</div>
|
||||||
|
<div className={styles.dataRow}>
|
||||||
|
<ResourceAgentLatency latency={agent.latency} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
)}
|
<TableCell>
|
||||||
|
<div className={styles.accessLinks}>
|
||||||
<TableCell className={styles.agentColumn}>
|
{canUpdateWorkspace && agent.status === "connected" && (
|
||||||
<TableCellDataPrimary highlight>{agent.name}</TableCellDataPrimary>
|
<>
|
||||||
<div className={styles.data}>
|
<SSHButton workspaceName={workspace.name} agentName={agent.name} />
|
||||||
<div className={styles.dataRow}>
|
<TerminalLink
|
||||||
<strong>{Language.statusLabel}</strong>
|
|
||||||
<span style={{ color: agentStatus.color }} className={styles.status}>
|
|
||||||
{agentStatus.status}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className={styles.dataRow}>
|
|
||||||
<strong>{Language.osLabel}</strong>
|
|
||||||
<span className={styles.operatingSystem}>{agent.operating_system}</span>
|
|
||||||
</div>
|
|
||||||
<div className={styles.dataRow}>
|
|
||||||
<strong>{Language.versionLabel}</strong>
|
|
||||||
<span className={styles.agentVersion}>{displayVersion}</span>
|
|
||||||
<AgentOutdatedTooltip outdated={outdated} />
|
|
||||||
</div>
|
|
||||||
<div className={styles.dataRow}>
|
|
||||||
<ResourceAgentLatency latency={agent.latency} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</TableCell>
|
|
||||||
<TableCell>
|
|
||||||
<div className={styles.accessLinks}>
|
|
||||||
{canUpdateWorkspace && agent.status === "connected" && (
|
|
||||||
<>
|
|
||||||
<SSHButton workspaceName={workspace.name} agentName={agent.name} />
|
|
||||||
<TerminalLink
|
|
||||||
workspaceName={workspace.name}
|
|
||||||
agentName={agent.name}
|
|
||||||
userName={workspace.owner_name}
|
|
||||||
/>
|
|
||||||
{agent.apps.map((app) => (
|
|
||||||
<AppLink
|
|
||||||
key={app.name}
|
|
||||||
appIcon={app.icon}
|
|
||||||
appName={app.name}
|
|
||||||
userName={workspace.owner_name}
|
|
||||||
workspaceName={workspace.name}
|
workspaceName={workspace.name}
|
||||||
agentName={agent.name}
|
agentName={agent.name}
|
||||||
|
userName={workspace.owner_name}
|
||||||
/>
|
/>
|
||||||
))}
|
{agent.apps.map((app) => (
|
||||||
</>
|
<AppLink
|
||||||
)}
|
key={app.name}
|
||||||
{canUpdateWorkspace && agent.status === "connecting" && (
|
appIcon={app.icon}
|
||||||
<>
|
appName={app.name}
|
||||||
<Skeleton width={80} height={60} />
|
userName={workspace.owner_name}
|
||||||
<Skeleton width={120} height={60} />
|
workspaceName={workspace.name}
|
||||||
</>
|
agentName={agent.name}
|
||||||
)}
|
/>
|
||||||
</div>
|
))}
|
||||||
</TableCell>
|
</>
|
||||||
</TableRow>
|
)}
|
||||||
)
|
{canUpdateWorkspace && agent.status === "connecting" && (
|
||||||
})
|
<>
|
||||||
})}
|
<Skeleton width={80} height={60} />
|
||||||
</TableBody>
|
<Skeleton width={120} height={60} />
|
||||||
</Table>
|
</>
|
||||||
</TableContainer>
|
)}
|
||||||
|
</div>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{hasHideResources && (
|
||||||
|
<div className={styles.buttonWrapper}>
|
||||||
|
<Button
|
||||||
|
className={styles.showMoreButton}
|
||||||
|
variant="outlined"
|
||||||
|
size="small"
|
||||||
|
onClick={() => setShouldDisplayHideResources((v) => !v)}
|
||||||
|
>
|
||||||
|
{shouldDisplayHideResources ? (
|
||||||
|
<>
|
||||||
|
Hide resources <CloseDropdown />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
Show hidden resources <OpenDropdown />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</Stack>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,4 +279,16 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
marginRight: theme.spacing(1),
|
marginRight: theme.spacing(1),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
buttonWrapper: {
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
},
|
||||||
|
|
||||||
|
showMoreButton: {
|
||||||
|
borderRadius: 9999,
|
||||||
|
width: "100%",
|
||||||
|
maxWidth: 260,
|
||||||
|
},
|
||||||
}))
|
}))
|
||||||
|
@ -40,7 +40,11 @@ Started.args = {
|
|||||||
workspace: Mocks.MockWorkspace,
|
workspace: Mocks.MockWorkspace,
|
||||||
handleStart: action("start"),
|
handleStart: action("start"),
|
||||||
handleStop: action("stop"),
|
handleStop: action("stop"),
|
||||||
resources: [Mocks.MockWorkspaceResource, Mocks.MockWorkspaceResource2],
|
resources: [
|
||||||
|
Mocks.MockWorkspaceResource,
|
||||||
|
Mocks.MockWorkspaceResource2,
|
||||||
|
Mocks.MockWorkspaceResource3,
|
||||||
|
],
|
||||||
builds: [Mocks.MockWorkspaceBuild],
|
builds: [Mocks.MockWorkspaceBuild],
|
||||||
canUpdateWorkspace: true,
|
canUpdateWorkspace: true,
|
||||||
workspaceErrors: {},
|
workspaceErrors: {},
|
||||||
|
@ -393,6 +393,7 @@ export const MockWorkspaceResource: TypesGen.WorkspaceResource = {
|
|||||||
name: "a-workspace-resource",
|
name: "a-workspace-resource",
|
||||||
type: "google_compute_disk",
|
type: "google_compute_disk",
|
||||||
workspace_transition: "start",
|
workspace_transition: "start",
|
||||||
|
hide: false,
|
||||||
metadata: [
|
metadata: [
|
||||||
{ key: "type", value: "a-workspace-resource", sensitive: false },
|
{ key: "type", value: "a-workspace-resource", sensitive: false },
|
||||||
{ key: "api_key", value: "12345678", sensitive: true },
|
{ key: "api_key", value: "12345678", sensitive: true },
|
||||||
@ -407,6 +408,22 @@ export const MockWorkspaceResource2: TypesGen.WorkspaceResource = {
|
|||||||
name: "another-workspace-resource",
|
name: "another-workspace-resource",
|
||||||
type: "google_compute_disk",
|
type: "google_compute_disk",
|
||||||
workspace_transition: "start",
|
workspace_transition: "start",
|
||||||
|
hide: false,
|
||||||
|
metadata: [
|
||||||
|
{ key: "type", value: "google_compute_disk", sensitive: false },
|
||||||
|
{ key: "size", value: "32GB", sensitive: false },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MockWorkspaceResource3: TypesGen.WorkspaceResource = {
|
||||||
|
agents: [MockWorkspaceAgent, MockWorkspaceAgentDisconnected, MockWorkspaceAgentOutdated],
|
||||||
|
created_at: "",
|
||||||
|
id: "test-workspace-resource-3",
|
||||||
|
job_id: "",
|
||||||
|
name: "another-workspace-resource",
|
||||||
|
type: "google_compute_disk",
|
||||||
|
workspace_transition: "start",
|
||||||
|
hide: true,
|
||||||
metadata: [
|
metadata: [
|
||||||
{ key: "type", value: "google_compute_disk", sensitive: false },
|
{ key: "type", value: "google_compute_disk", sensitive: false },
|
||||||
{ key: "size", value: "32GB", sensitive: false },
|
{ key: "size", value: "32GB", sensitive: false },
|
||||||
|
@ -67,8 +67,9 @@ export const getOverrides = ({ palette, breakpoints }: Theme): Overrides => {
|
|||||||
},
|
},
|
||||||
outlined: {
|
outlined: {
|
||||||
border: `1px solid ${palette.divider}`,
|
border: `1px solid ${palette.divider}`,
|
||||||
|
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
backgroundColor: palette.background.default,
|
backgroundColor: palette.action.hover,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user