From 57e130f162f234d050709a5ae264c571048467fd Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 17:30:35 +0000 Subject: [PATCH 01/11] chore: Invert `delay_login_until_ready`, now `login_before_ready` --- cli/cliui/agent.go | 6 +- cli/cliui/agent_test.go | 34 +- coderd/apidoc/docs.go | 8 +- coderd/apidoc/swagger.json | 8 +- coderd/database/dump.sql | 4 +- ...until_ready_to_login_before_ready.down.sql | 8 + ...n_until_ready_to_login_before_ready.up.sql | 8 + coderd/database/models.go | 4 +- coderd/database/queries.sql.go | 30 +- coderd/database/queries/workspaceagents.sql | 2 +- .../provisionerdserver/provisionerdserver.go | 2 +- coderd/workspaceagents.go | 2 +- codersdk/workspaceagents.go | 4 +- docs/api/agents.md | 2 +- docs/api/builds.md | 16 +- docs/api/schemas.md | 12 +- docs/api/templates.md | 8 +- docs/api/workspaces.md | 8 +- provisioner/terraform/resources.go | 4 +- provisioner/terraform/resources_test.go | 6 +- .../multiple-agents/multiple-agents.tf | 22 +- .../multiple-agents.tfplan.json | 22 +- .../multiple-agents.tfstate.json | 20 +- provisionersdk/proto/provisioner.pb.go | 370 +++++++++--------- provisionersdk/proto/provisioner.proto | 2 +- site/src/api/typesGenerated.ts | 2 +- site/src/components/Resources/AgentStatus.tsx | 40 +- site/src/testHelpers/entities.ts | 2 +- 28 files changed, 336 insertions(+), 320 deletions(-) create mode 100644 coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.down.sql create mode 100644 coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.up.sql diff --git a/cli/cliui/agent.go b/cli/cliui/agent.go index 940d4188739a4..f4ff03a606c8c 100644 --- a/cli/cliui/agent.go +++ b/cli/cliui/agent.go @@ -45,7 +45,7 @@ func Agent(ctx context.Context, writer io.Writer, opts AgentOptions) error { // We don't take the fast path for opts.NoWait yet because we want to // show the message. if agent.Status == codersdk.WorkspaceAgentConnected && - (!agent.DelayLoginUntilReady || agent.LifecycleState == codersdk.WorkspaceAgentLifecycleReady) { + (agent.LoginBeforeReady || agent.LifecycleState == codersdk.WorkspaceAgentLifecycleReady) { return nil } @@ -93,7 +93,7 @@ func Agent(ctx context.Context, writer io.Writer, opts AgentOptions) error { // we do this just before starting the spinner to avoid needless // spinning. if agent.Status == codersdk.WorkspaceAgentConnected && - agent.DelayLoginUntilReady && opts.NoWait { + !agent.LoginBeforeReady && opts.NoWait { showMessage() return nil } @@ -137,7 +137,7 @@ func Agent(ctx context.Context, writer io.Writer, opts AgentOptions) error { // NOTE(mafredri): Once we have access to the workspace agent's // startup script logs, we can show them here. // https://github.com/coder/coder/issues/2957 - if agent.DelayLoginUntilReady && !opts.NoWait { + if !agent.LoginBeforeReady && !opts.NoWait { switch agent.LifecycleState { case codersdk.WorkspaceAgentLifecycleReady: return nil diff --git a/cli/cliui/agent_test.go b/cli/cliui/agent_test.go index 4521e443ae822..435cbac0d8a8e 100644 --- a/cli/cliui/agent_test.go +++ b/cli/cliui/agent_test.go @@ -119,10 +119,10 @@ func TestAgent_StartupTimeout(t *testing.T) { WorkspaceName: "example", Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) { agent := codersdk.WorkspaceAgent{ - Status: codersdk.WorkspaceAgentConnecting, - DelayLoginUntilReady: true, - LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, - TroubleshootingURL: wantURL, + Status: codersdk.WorkspaceAgentConnecting, + LoginBeforeReady: false, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, + TroubleshootingURL: wantURL, } if s := status.Load(); s != "" { @@ -177,10 +177,10 @@ func TestAgent_StartErrorExit(t *testing.T) { WorkspaceName: "example", Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) { agent := codersdk.WorkspaceAgent{ - Status: codersdk.WorkspaceAgentConnecting, - DelayLoginUntilReady: true, - LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, - TroubleshootingURL: wantURL, + Status: codersdk.WorkspaceAgentConnecting, + LoginBeforeReady: false, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, + TroubleshootingURL: wantURL, } if s := status.Load(); s != "" { @@ -232,10 +232,10 @@ func TestAgent_NoWait(t *testing.T) { WorkspaceName: "example", Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) { agent := codersdk.WorkspaceAgent{ - Status: codersdk.WorkspaceAgentConnecting, - DelayLoginUntilReady: true, - LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, - TroubleshootingURL: wantURL, + Status: codersdk.WorkspaceAgentConnecting, + LoginBeforeReady: false, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, + TroubleshootingURL: wantURL, } if s := status.Load(); s != "" { @@ -284,7 +284,7 @@ func TestAgent_NoWait(t *testing.T) { require.NoError(t, <-done, "ready - should exit early") } -func TestAgent_DelayLoginUntilReadyDisabled(t *testing.T) { +func TestAgent_LoginBeforeReadyEnabled(t *testing.T) { t.Parallel() ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) @@ -301,10 +301,10 @@ func TestAgent_DelayLoginUntilReadyDisabled(t *testing.T) { WorkspaceName: "example", Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) { agent := codersdk.WorkspaceAgent{ - Status: codersdk.WorkspaceAgentConnecting, - DelayLoginUntilReady: false, - LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, - TroubleshootingURL: wantURL, + Status: codersdk.WorkspaceAgentConnecting, + LoginBeforeReady: true, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, + TroubleshootingURL: wantURL, } if s := status.Load(); s != "" { diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index dc3e48e227712..d5d7dab0f5fdf 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -7770,10 +7770,6 @@ const docTemplate = `{ "type": "string", "format": "date-time" }, - "delay_login_until_ready": { - "description": "DelayLoginUntilReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended).", - "type": "boolean" - }, "directory": { "type": "string" }, @@ -7812,6 +7808,10 @@ const docTemplate = `{ "lifecycle_state": { "$ref": "#/definitions/codersdk.WorkspaceAgentLifecycle" }, + "login_before_ready": { + "description": "LoginBeforeReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended).", + "type": "boolean" + }, "name": { "type": "string" }, diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 54ea588eac62c..ae4e160a335de 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -6985,10 +6985,6 @@ "type": "string", "format": "date-time" }, - "delay_login_until_ready": { - "description": "DelayLoginUntilReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended).", - "type": "boolean" - }, "directory": { "type": "string" }, @@ -7027,6 +7023,10 @@ "lifecycle_state": { "$ref": "#/definitions/codersdk.WorkspaceAgentLifecycle" }, + "login_before_ready": { + "description": "LoginBeforeReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended).", + "type": "boolean" + }, "name": { "type": "string" }, diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index b722305ae217b..664f2648e2123 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -461,7 +461,7 @@ CREATE TABLE workspace_agents ( troubleshooting_url text DEFAULT ''::text NOT NULL, motd_file text DEFAULT ''::text NOT NULL, lifecycle_state workspace_agent_lifecycle_state DEFAULT 'created'::workspace_agent_lifecycle_state NOT NULL, - delay_login_until_ready boolean DEFAULT false NOT NULL, + login_before_ready boolean DEFAULT true NOT NULL, startup_script_timeout_seconds integer DEFAULT 0 NOT NULL ); @@ -475,7 +475,7 @@ COMMENT ON COLUMN workspace_agents.motd_file IS 'Path to file inside workspace c COMMENT ON COLUMN workspace_agents.lifecycle_state IS 'The current lifecycle state reported by the workspace agent.'; -COMMENT ON COLUMN workspace_agents.delay_login_until_ready IS 'If true, the agent will delay logins until it is ready (e.g. executing startup script has ended).'; +COMMENT ON COLUMN workspace_agents.login_before_ready IS 'If true, the agent will not prevent login before it is ready (e.g. startup script is still executing).'; COMMENT ON COLUMN workspace_agents.startup_script_timeout_seconds IS 'The number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout.'; diff --git a/coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.down.sql b/coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.down.sql new file mode 100644 index 0000000000000..9fec239936190 --- /dev/null +++ b/coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.down.sql @@ -0,0 +1,8 @@ +BEGIN; +ALTER TABLE workspace_agents RENAME COLUMN login_before_ready TO delay_login_until_ready; +ALTER TABLE workspace_agents ALTER COLUMN delay_login_until_ready SET DEFAULT false; + +UPDATE workspace_agents SET delay_login_until_ready = NOT delay_login_until_ready; + +COMMENT ON COLUMN workspace_agents.delay_login_until_ready IS 'If true, the agent will delay logins until it is ready (e.g. executing startup script has ended).'; +COMMIT; diff --git a/coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.up.sql b/coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.up.sql new file mode 100644 index 0000000000000..2f49830da4a11 --- /dev/null +++ b/coderd/database/migrations/000093_add_workspace_agent_invert_delay_login_until_ready_to_login_before_ready.up.sql @@ -0,0 +1,8 @@ +BEGIN; +ALTER TABLE workspace_agents RENAME COLUMN delay_login_until_ready TO login_before_ready; +ALTER TABLE workspace_agents ALTER COLUMN login_before_ready SET DEFAULT true; + +UPDATE workspace_agents SET login_before_ready = NOT login_before_ready; + +COMMENT ON COLUMN workspace_agents.login_before_ready IS 'If true, the agent will not prevent login before it is ready (e.g. startup script is still executing).'; +COMMIT; diff --git a/coderd/database/models.go b/coderd/database/models.go index 7af40ebbac980..8496c75df2114 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -1519,8 +1519,8 @@ type WorkspaceAgent struct { MOTDFile string `db:"motd_file" json:"motd_file"` // The current lifecycle state reported by the workspace agent. LifecycleState WorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"` - // If true, the agent will delay logins until it is ready (e.g. executing startup script has ended). - DelayLoginUntilReady bool `db:"delay_login_until_ready" json:"delay_login_until_ready"` + // If true, the agent will not prevent login before it is ready (e.g. startup script is still executing). + LoginBeforeReady bool `db:"login_before_ready" json:"login_before_ready"` // The number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout. StartupScriptTimeoutSeconds int32 `db:"startup_script_timeout_seconds" json:"startup_script_timeout_seconds"` } diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index ab18baca5cc4a..28d29f5ba0b0e 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -4840,7 +4840,7 @@ func (q *sqlQuerier) UpdateUserStatus(ctx context.Context, arg UpdateUserStatusP const getWorkspaceAgentByAuthToken = `-- name: GetWorkspaceAgentByAuthToken :one SELECT - id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, delay_login_until_ready, startup_script_timeout_seconds + id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, login_before_ready, startup_script_timeout_seconds FROM workspace_agents WHERE @@ -4876,7 +4876,7 @@ func (q *sqlQuerier) GetWorkspaceAgentByAuthToken(ctx context.Context, authToken &i.TroubleshootingURL, &i.MOTDFile, &i.LifecycleState, - &i.DelayLoginUntilReady, + &i.LoginBeforeReady, &i.StartupScriptTimeoutSeconds, ) return i, err @@ -4884,7 +4884,7 @@ func (q *sqlQuerier) GetWorkspaceAgentByAuthToken(ctx context.Context, authToken const getWorkspaceAgentByID = `-- name: GetWorkspaceAgentByID :one SELECT - id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, delay_login_until_ready, startup_script_timeout_seconds + id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, login_before_ready, startup_script_timeout_seconds FROM workspace_agents WHERE @@ -4918,7 +4918,7 @@ func (q *sqlQuerier) GetWorkspaceAgentByID(ctx context.Context, id uuid.UUID) (W &i.TroubleshootingURL, &i.MOTDFile, &i.LifecycleState, - &i.DelayLoginUntilReady, + &i.LoginBeforeReady, &i.StartupScriptTimeoutSeconds, ) return i, err @@ -4926,7 +4926,7 @@ func (q *sqlQuerier) GetWorkspaceAgentByID(ctx context.Context, id uuid.UUID) (W const getWorkspaceAgentByInstanceID = `-- name: GetWorkspaceAgentByInstanceID :one SELECT - id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, delay_login_until_ready, startup_script_timeout_seconds + id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, login_before_ready, startup_script_timeout_seconds FROM workspace_agents WHERE @@ -4962,7 +4962,7 @@ func (q *sqlQuerier) GetWorkspaceAgentByInstanceID(ctx context.Context, authInst &i.TroubleshootingURL, &i.MOTDFile, &i.LifecycleState, - &i.DelayLoginUntilReady, + &i.LoginBeforeReady, &i.StartupScriptTimeoutSeconds, ) return i, err @@ -4970,7 +4970,7 @@ func (q *sqlQuerier) GetWorkspaceAgentByInstanceID(ctx context.Context, authInst const getWorkspaceAgentsByResourceIDs = `-- name: GetWorkspaceAgentsByResourceIDs :many SELECT - id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, delay_login_until_ready, startup_script_timeout_seconds + id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, login_before_ready, startup_script_timeout_seconds FROM workspace_agents WHERE @@ -5010,7 +5010,7 @@ func (q *sqlQuerier) GetWorkspaceAgentsByResourceIDs(ctx context.Context, ids [] &i.TroubleshootingURL, &i.MOTDFile, &i.LifecycleState, - &i.DelayLoginUntilReady, + &i.LoginBeforeReady, &i.StartupScriptTimeoutSeconds, ); err != nil { return nil, err @@ -5027,7 +5027,7 @@ func (q *sqlQuerier) GetWorkspaceAgentsByResourceIDs(ctx context.Context, ids [] } const getWorkspaceAgentsCreatedAfter = `-- name: GetWorkspaceAgentsCreatedAfter :many -SELECT id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, delay_login_until_ready, startup_script_timeout_seconds FROM workspace_agents WHERE created_at > $1 +SELECT id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, login_before_ready, startup_script_timeout_seconds FROM workspace_agents WHERE created_at > $1 ` func (q *sqlQuerier) GetWorkspaceAgentsCreatedAfter(ctx context.Context, createdAt time.Time) ([]WorkspaceAgent, error) { @@ -5063,7 +5063,7 @@ func (q *sqlQuerier) GetWorkspaceAgentsCreatedAfter(ctx context.Context, created &i.TroubleshootingURL, &i.MOTDFile, &i.LifecycleState, - &i.DelayLoginUntilReady, + &i.LoginBeforeReady, &i.StartupScriptTimeoutSeconds, ); err != nil { return nil, err @@ -5099,11 +5099,11 @@ INSERT INTO connection_timeout_seconds, troubleshooting_url, motd_file, - delay_login_until_ready, + login_before_ready, startup_script_timeout_seconds ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, delay_login_until_ready, startup_script_timeout_seconds + ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) RETURNING id, created_at, updated_at, name, first_connected_at, last_connected_at, disconnected_at, resource_id, auth_token, auth_instance_id, architecture, environment_variables, operating_system, startup_script, instance_metadata, resource_metadata, directory, version, last_connected_replica_id, connection_timeout_seconds, troubleshooting_url, motd_file, lifecycle_state, login_before_ready, startup_script_timeout_seconds ` type InsertWorkspaceAgentParams struct { @@ -5124,7 +5124,7 @@ type InsertWorkspaceAgentParams struct { ConnectionTimeoutSeconds int32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"` TroubleshootingURL string `db:"troubleshooting_url" json:"troubleshooting_url"` MOTDFile string `db:"motd_file" json:"motd_file"` - DelayLoginUntilReady bool `db:"delay_login_until_ready" json:"delay_login_until_ready"` + LoginBeforeReady bool `db:"login_before_ready" json:"login_before_ready"` StartupScriptTimeoutSeconds int32 `db:"startup_script_timeout_seconds" json:"startup_script_timeout_seconds"` } @@ -5147,7 +5147,7 @@ func (q *sqlQuerier) InsertWorkspaceAgent(ctx context.Context, arg InsertWorkspa arg.ConnectionTimeoutSeconds, arg.TroubleshootingURL, arg.MOTDFile, - arg.DelayLoginUntilReady, + arg.LoginBeforeReady, arg.StartupScriptTimeoutSeconds, ) var i WorkspaceAgent @@ -5175,7 +5175,7 @@ func (q *sqlQuerier) InsertWorkspaceAgent(ctx context.Context, arg InsertWorkspa &i.TroubleshootingURL, &i.MOTDFile, &i.LifecycleState, - &i.DelayLoginUntilReady, + &i.LoginBeforeReady, &i.StartupScriptTimeoutSeconds, ) return i, err diff --git a/coderd/database/queries/workspaceagents.sql b/coderd/database/queries/workspaceagents.sql index 25e7de2863459..8ff681823016e 100644 --- a/coderd/database/queries/workspaceagents.sql +++ b/coderd/database/queries/workspaceagents.sql @@ -57,7 +57,7 @@ INSERT INTO connection_timeout_seconds, troubleshooting_url, motd_file, - delay_login_until_ready, + login_before_ready, startup_script_timeout_seconds ) VALUES diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index cc8bb604a26d0..424ac100c9c4a 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -972,7 +972,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid. ConnectionTimeoutSeconds: prAgent.GetConnectionTimeoutSeconds(), TroubleshootingURL: prAgent.GetTroubleshootingUrl(), MOTDFile: prAgent.GetMotdFile(), - DelayLoginUntilReady: prAgent.GetDelayLoginUntilReady(), + LoginBeforeReady: prAgent.GetLoginBeforeReady(), StartupScriptTimeoutSeconds: prAgent.GetStartupScriptTimeoutSeconds(), }) if err != nil { diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index 32dc30b313781..6bd848d072f3a 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -785,7 +785,7 @@ func convertWorkspaceAgent(derpMap *tailcfg.DERPMap, coordinator tailnet.Coordin ConnectionTimeoutSeconds: dbAgent.ConnectionTimeoutSeconds, TroubleshootingURL: troubleshootingURL, LifecycleState: codersdk.WorkspaceAgentLifecycle(dbAgent.LifecycleState), - DelayLoginUntilReady: dbAgent.DelayLoginUntilReady, + LoginBeforeReady: dbAgent.LoginBeforeReady, StartupScriptTimeoutSeconds: dbAgent.StartupScriptTimeoutSeconds, } node := coordinator.Node(dbAgent.ID) diff --git a/codersdk/workspaceagents.go b/codersdk/workspaceagents.go index 125bd2a5ef7c7..3d9a085b9f99a 100644 --- a/codersdk/workspaceagents.go +++ b/codersdk/workspaceagents.go @@ -77,8 +77,8 @@ type WorkspaceAgent struct { DERPLatency map[string]DERPRegion `json:"latency,omitempty"` ConnectionTimeoutSeconds int32 `json:"connection_timeout_seconds"` TroubleshootingURL string `json:"troubleshooting_url"` - // DelayLoginUntilReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). - DelayLoginUntilReady bool `db:"delay_login_until_ready" json:"delay_login_until_ready"` + // LoginBeforeReady if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). + LoginBeforeReady bool `db:"login_before_ready" json:"login_before_ready"` // StartupScriptTimeoutSeconds is the number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout. StartupScriptTimeoutSeconds int32 `db:"startup_script_timeout_seconds" json:"startup_script_timeout_seconds"` } diff --git a/docs/api/agents.md b/docs/api/agents.md index 3359c66e32628..e4f746a188bd6 100644 --- a/docs/api/agents.md +++ b/docs/api/agents.md @@ -484,7 +484,6 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \ "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -506,6 +505,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \ } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", diff --git a/docs/api/builds.md b/docs/api/builds.md index ee5d3392b5122..8dc8c107fad17 100644 --- a/docs/api/builds.md +++ b/docs/api/builds.md @@ -76,7 +76,6 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -98,6 +97,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -221,7 +221,6 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -243,6 +242,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -509,7 +509,6 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -531,6 +530,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -594,7 +594,6 @@ Status Code **200** | `»» architecture` | string | false | | | | `»» connection_timeout_seconds` | integer | false | | | | `»» created_at` | string(date-time) | false | | | -| `»» delay_login_until_ready` | boolean | false | | »delay login until ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»» directory` | string | false | | | | `»» disconnected_at` | string(date-time) | false | | | | `»» environment_variables` | object | false | | | @@ -608,6 +607,7 @@ Status Code **200** | `»»»» latency_ms` | number | false | | | | `»»»» preferred` | boolean | false | | | | `»» lifecycle_state` | [codersdk.WorkspaceAgentLifecycle](schemas.md#codersdkworkspaceagentlifecycle) | false | | | +| `»» login_before_ready` | boolean | false | | »login before ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»» name` | string | false | | | | `»» operating_system` | string | false | | | | `»» resource_id` | string(uuid) | false | | | @@ -731,7 +731,6 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -753,6 +752,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -881,7 +881,6 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -903,6 +902,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -998,7 +998,6 @@ Status Code **200** | `»»» architecture` | string | false | | | | `»»» connection_timeout_seconds` | integer | false | | | | `»»» created_at` | string(date-time) | false | | | -| `»»» delay_login_until_ready` | boolean | false | | »»delay login until ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»»» directory` | string | false | | | | `»»» disconnected_at` | string(date-time) | false | | | | `»»» environment_variables` | object | false | | | @@ -1012,6 +1011,7 @@ Status Code **200** | `»»»»» latency_ms` | number | false | | | | `»»»»» preferred` | boolean | false | | | | `»»» lifecycle_state` | [codersdk.WorkspaceAgentLifecycle](schemas.md#codersdkworkspaceagentlifecycle) | false | | | +| `»»» login_before_ready` | boolean | false | | »»login before ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»»» name` | string | false | | | | `»»» operating_system` | string | false | | | | `»»» resource_id` | string(uuid) | false | | | @@ -1195,7 +1195,6 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -1217,6 +1216,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", diff --git a/docs/api/schemas.md b/docs/api/schemas.md index cf5a0392b889f..6eacdfaa5c633 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -4615,7 +4615,6 @@ Parameter represents a set value for the scope. "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -4637,6 +4636,7 @@ Parameter represents a set value for the scope. } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -4737,7 +4737,6 @@ Parameter represents a set value for the scope. "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -4759,6 +4758,7 @@ Parameter represents a set value for the scope. } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -4779,7 +4779,6 @@ Parameter represents a set value for the scope. | `architecture` | string | false | | | | `connection_timeout_seconds` | integer | false | | | | `created_at` | string | false | | | -| `delay_login_until_ready` | boolean | false | | Delay login until ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `directory` | string | false | | | | `disconnected_at` | string | false | | | | `environment_variables` | object | false | | | @@ -4791,6 +4790,7 @@ Parameter represents a set value for the scope. | `latency` | object | false | | Latency is mapped by region name (e.g. "New York City", "Seattle"). | | » `[any property]` | [codersdk.DERPRegion](#codersdkderpregion) | false | | | | `lifecycle_state` | [codersdk.WorkspaceAgentLifecycle](#codersdkworkspaceagentlifecycle) | false | | | +| `login_before_ready` | boolean | false | | Login before ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `name` | string | false | | | | `operating_system` | string | false | | | | `resource_id` | string | false | | | @@ -5166,7 +5166,6 @@ Parameter represents a set value for the scope. "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -5188,6 +5187,7 @@ Parameter represents a set value for the scope. } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -5334,7 +5334,6 @@ Parameter represents a set value for the scope. "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -5356,6 +5355,7 @@ Parameter represents a set value for the scope. } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -5524,7 +5524,6 @@ Parameter represents a set value for the scope. "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -5546,6 +5545,7 @@ Parameter represents a set value for the scope. } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", diff --git a/docs/api/templates.md b/docs/api/templates.md index 68176dc6d5d25..24c23594d96b4 100644 --- a/docs/api/templates.md +++ b/docs/api/templates.md @@ -1564,7 +1564,6 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -1586,6 +1585,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -1649,7 +1649,6 @@ Status Code **200** | `»» architecture` | string | false | | | | `»» connection_timeout_seconds` | integer | false | | | | `»» created_at` | string(date-time) | false | | | -| `»» delay_login_until_ready` | boolean | false | | »delay login until ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»» directory` | string | false | | | | `»» disconnected_at` | string(date-time) | false | | | | `»» environment_variables` | object | false | | | @@ -1663,6 +1662,7 @@ Status Code **200** | `»»»» latency_ms` | number | false | | | | `»»»» preferred` | boolean | false | | | | `»» lifecycle_state` | [codersdk.WorkspaceAgentLifecycle](schemas.md#codersdkworkspaceagentlifecycle) | false | | | +| `»» login_before_ready` | boolean | false | | »login before ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»» name` | string | false | | | | `»» operating_system` | string | false | | | | `»» resource_id` | string(uuid) | false | | | @@ -1916,7 +1916,6 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -1938,6 +1937,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -2001,7 +2001,6 @@ Status Code **200** | `»» architecture` | string | false | | | | `»» connection_timeout_seconds` | integer | false | | | | `»» created_at` | string(date-time) | false | | | -| `»» delay_login_until_ready` | boolean | false | | »delay login until ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»» directory` | string | false | | | | `»» disconnected_at` | string(date-time) | false | | | | `»» environment_variables` | object | false | | | @@ -2015,6 +2014,7 @@ Status Code **200** | `»»»» latency_ms` | number | false | | | | `»»»» preferred` | boolean | false | | | | `»» lifecycle_state` | [codersdk.WorkspaceAgentLifecycle](schemas.md#codersdkworkspaceagentlifecycle) | false | | | +| `»» login_before_ready` | boolean | false | | »login before ready if true, the agent will delay logins until it is ready (e.g. executing startup script has ended). | | `»» name` | string | false | | | | `»» operating_system` | string | false | | | | `»» resource_id` | string(uuid) | false | | | diff --git a/docs/api/workspaces.md b/docs/api/workspaces.md index f51d33d76dbd8..b1c5efbd6e9c2 100644 --- a/docs/api/workspaces.md +++ b/docs/api/workspaces.md @@ -80,7 +80,6 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -102,6 +101,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -244,7 +244,6 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -266,6 +265,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -427,7 +427,6 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -449,6 +448,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", @@ -592,7 +592,6 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \ "architecture": "string", "connection_timeout_seconds": 0, "created_at": "2019-08-24T14:15:22Z", - "delay_login_until_ready": true, "directory": "string", "disconnected_at": "2019-08-24T14:15:22Z", "environment_variables": { @@ -614,6 +613,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \ } }, "lifecycle_state": "created", + "login_before_ready": true, "name": "string", "operating_system": "string", "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index 913d297873bf1..9dc4e770bc519 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -27,7 +27,7 @@ type agentAttributes struct { ConnectionTimeoutSeconds int32 `mapstructure:"connection_timeout"` TroubleshootingURL string `mapstructure:"troubleshooting_url"` MOTDFile string `mapstructure:"motd_file"` - DelayLoginUntilReady bool `mapstructure:"delay_login_until_ready"` + LoginBeforeReady bool `mapstructure:"login_before_ready"` StartupScriptTimeoutSeconds int32 `mapstructure:"startup_script_timeout"` } @@ -134,7 +134,7 @@ func ConvertResourcesAndParameters(modules []*tfjson.StateModule, rawGraph strin ConnectionTimeoutSeconds: attrs.ConnectionTimeoutSeconds, TroubleshootingUrl: attrs.TroubleshootingURL, MotdFile: attrs.MOTDFile, - DelayLoginUntilReady: attrs.DelayLoginUntilReady, + LoginBeforeReady: attrs.LoginBeforeReady, StartupScriptTimeoutSeconds: attrs.StartupScriptTimeoutSeconds, } switch attrs.Auth { diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index 95d81b7540317..eb62894e8778b 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -105,7 +105,7 @@ func TestConvertResources(t *testing.T) { Architecture: "amd64", Auth: &proto.Agent_Token{}, ConnectionTimeoutSeconds: 120, - DelayLoginUntilReady: false, + LoginBeforeReady: true, StartupScriptTimeoutSeconds: 300, }, { Name: "dev2", @@ -114,7 +114,7 @@ func TestConvertResources(t *testing.T) { Auth: &proto.Agent_Token{}, ConnectionTimeoutSeconds: 1, MotdFile: "/etc/motd", - DelayLoginUntilReady: false, + LoginBeforeReady: true, StartupScriptTimeoutSeconds: 30, }, { Name: "dev3", @@ -123,7 +123,7 @@ func TestConvertResources(t *testing.T) { Auth: &proto.Agent_Token{}, ConnectionTimeoutSeconds: 120, TroubleshootingUrl: "https://coder.com/troubleshoot", - DelayLoginUntilReady: true, + LoginBeforeReady: false, StartupScriptTimeoutSeconds: 300, }}, }}, diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf index 3db1113f2dd3b..1f266bbe0f450 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tf @@ -2,7 +2,7 @@ terraform { required_providers { coder = { source = "coder/coder" - version = "0.6.7" + version = "0.6.10" } } } @@ -13,19 +13,19 @@ resource "coder_agent" "dev1" { } resource "coder_agent" "dev2" { - os = "darwin" - arch = "amd64" - connection_timeout = 1 - motd_file = "/etc/motd" - startup_script_timeout = 30 - delay_login_until_ready = false + os = "darwin" + arch = "amd64" + connection_timeout = 1 + motd_file = "/etc/motd" + startup_script_timeout = 30 + login_before_ready = true } resource "coder_agent" "dev3" { - os = "windows" - arch = "arm64" - troubleshooting_url = "https://coder.com/troubleshoot" - delay_login_until_ready = true + os = "windows" + arch = "arm64" + troubleshooting_url = "https://coder.com/troubleshoot" + login_before_ready = false } resource "null_resource" "dev" { diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json index ef9f6e331b9a6..2f549b9ab2b57 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfplan.json @@ -15,9 +15,9 @@ "arch": "amd64", "auth": "token", "connection_timeout": 120, - "delay_login_until_ready": false, "dir": null, "env": null, + "login_before_ready": true, "motd_file": null, "os": "linux", "shutdown_script": null, @@ -38,9 +38,9 @@ "arch": "amd64", "auth": "token", "connection_timeout": 1, - "delay_login_until_ready": false, "dir": null, "env": null, + "login_before_ready": true, "motd_file": "/etc/motd", "os": "darwin", "shutdown_script": null, @@ -61,9 +61,9 @@ "arch": "arm64", "auth": "token", "connection_timeout": 120, - "delay_login_until_ready": true, "dir": null, "env": null, + "login_before_ready": false, "motd_file": null, "os": "windows", "shutdown_script": null, @@ -104,9 +104,9 @@ "arch": "amd64", "auth": "token", "connection_timeout": 120, - "delay_login_until_ready": false, "dir": null, "env": null, + "login_before_ready": true, "motd_file": null, "os": "linux", "shutdown_script": null, @@ -140,9 +140,9 @@ "arch": "amd64", "auth": "token", "connection_timeout": 1, - "delay_login_until_ready": false, "dir": null, "env": null, + "login_before_ready": true, "motd_file": "/etc/motd", "os": "darwin", "shutdown_script": null, @@ -176,9 +176,9 @@ "arch": "arm64", "auth": "token", "connection_timeout": 120, - "delay_login_until_ready": true, "dir": null, "env": null, + "login_before_ready": false, "motd_file": null, "os": "windows", "shutdown_script": null, @@ -224,7 +224,7 @@ "coder": { "name": "coder", "full_name": "registry.terraform.io/coder/coder", - "version_constraint": "0.6.7" + "version_constraint": "0.6.10" }, "null": { "name": "null", @@ -262,8 +262,8 @@ "connection_timeout": { "constant_value": 1 }, - "delay_login_until_ready": { - "constant_value": false + "login_before_ready": { + "constant_value": true }, "motd_file": { "constant_value": "/etc/motd" @@ -287,8 +287,8 @@ "arch": { "constant_value": "arm64" }, - "delay_login_until_ready": { - "constant_value": true + "login_before_ready": { + "constant_value": false }, "os": { "constant_value": "windows" diff --git a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json index b4f0d1594bdf5..2c9d78e8e5645 100644 --- a/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json +++ b/provisioner/terraform/testdata/multiple-agents/multiple-agents.tfstate.json @@ -15,17 +15,17 @@ "arch": "amd64", "auth": "token", "connection_timeout": 120, - "delay_login_until_ready": false, "dir": null, "env": null, - "id": "8ba856b4-4aa9-4fbe-aa04-9af53dc93f08", + "id": "6b912abe-50d4-48b2-be7c-1464ca69b5b9", "init_script": "", + "login_before_ready": true, "motd_file": null, "os": "linux", "shutdown_script": null, "startup_script": null, "startup_script_timeout": 300, - "token": "c7f72bfa-c84c-4b52-898c-1c056a42141e", + "token": "d296a9cd-6f7c-4c6b-b2f3-7a647512efe8", "troubleshooting_url": null }, "sensitive_values": {} @@ -41,17 +41,17 @@ "arch": "amd64", "auth": "token", "connection_timeout": 1, - "delay_login_until_ready": false, "dir": null, "env": null, - "id": "3e79acd5-88f4-4de6-8145-a8e0e2b1129b", + "id": "8a2956f7-d37b-441e-bf62-bd9a45316f6a", "init_script": "", + "login_before_ready": true, "motd_file": "/etc/motd", "os": "darwin", "shutdown_script": null, "startup_script": null, "startup_script_timeout": 30, - "token": "0e2fa4e7-df44-41c4-a6e4-9e46c6f5e441", + "token": "b1e0fba4-5bba-439f-b3ea-3f6a8ba4d301", "troubleshooting_url": null }, "sensitive_values": {} @@ -67,17 +67,17 @@ "arch": "arm64", "auth": "token", "connection_timeout": 120, - "delay_login_until_ready": true, "dir": null, "env": null, - "id": "c9df6531-41f4-4005-b1a7-b4c4712b117f", + "id": "819b1b19-a709-463e-9aeb-5e1321b7af23", "init_script": "", + "login_before_ready": false, "motd_file": null, "os": "windows", "shutdown_script": null, "startup_script": null, "startup_script_timeout": 300, - "token": "68f0e144-22ce-455f-be00-edef913f34a6", + "token": "238ff017-12ae-403f-b3f8-4dea4dc87a7d", "troubleshooting_url": "https://coder.com/troubleshoot" }, "sensitive_values": {} @@ -90,7 +90,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "5895060021397476995", + "id": "5288433022262248914", "triggers": null }, "sensitive_values": {}, diff --git a/provisionersdk/proto/provisioner.pb.go b/provisionersdk/proto/provisioner.pb.go index 7d524f551836d..afbce92322113 100644 --- a/provisionersdk/proto/provisioner.pb.go +++ b/provisionersdk/proto/provisioner.pb.go @@ -1025,7 +1025,7 @@ type Agent struct { ConnectionTimeoutSeconds int32 `protobuf:"varint,11,opt,name=connection_timeout_seconds,json=connectionTimeoutSeconds,proto3" json:"connection_timeout_seconds,omitempty"` TroubleshootingUrl string `protobuf:"bytes,12,opt,name=troubleshooting_url,json=troubleshootingUrl,proto3" json:"troubleshooting_url,omitempty"` MotdFile string `protobuf:"bytes,13,opt,name=motd_file,json=motdFile,proto3" json:"motd_file,omitempty"` - DelayLoginUntilReady bool `protobuf:"varint,14,opt,name=delay_login_until_ready,json=delayLoginUntilReady,proto3" json:"delay_login_until_ready,omitempty"` + LoginBeforeReady bool `protobuf:"varint,14,opt,name=login_before_ready,json=loginBeforeReady,proto3" json:"login_before_ready,omitempty"` StartupScriptTimeoutSeconds int32 `protobuf:"varint,15,opt,name=startup_script_timeout_seconds,json=startupScriptTimeoutSeconds,proto3" json:"startup_script_timeout_seconds,omitempty"` } @@ -1159,9 +1159,9 @@ func (x *Agent) GetMotdFile() string { return "" } -func (x *Agent) GetDelayLoginUntilReady() bool { +func (x *Agent) GetLoginBeforeReady() bool { if x != nil { - return x.DelayLoginUntilReady + return x.LoginBeforeReady } return false } @@ -2486,7 +2486,7 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x49, 0x64, 0x22, 0x97, 0x05, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x49, 0x64, 0x22, 0x8e, 0x05, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, @@ -2516,188 +2516,188 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{ 0x12, 0x74, 0x72, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x73, 0x68, 0x6f, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, 0x74, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x74, 0x64, 0x46, 0x69, 0x6c, 0x65, - 0x12, 0x35, 0x0a, 0x17, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, - 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x14, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x6e, 0x74, - 0x69, 0x6c, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x43, 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x75, 0x70, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x1b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0x36, 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, 0xb5, 0x02, 0x0a, - 0x03, 0x41, 0x70, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, - 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 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, 0x07, 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, 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, - 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x68, - 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, - 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 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, - 0xf1, 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, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x69, - 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, - 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, 0x73, 0x74, 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, 0x82, 0x0a, 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, 0x79, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 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, 0x1a, - 0xda, 0x01, 0x0a, 0x04, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x35, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x01, 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, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x53, 0x0a, 0x15, 0x72, 0x69, 0x63, 0x68, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x72, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x52, 0x0a, 0x05, - 0x41, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x35, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x01, 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, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, - 0x1a, 0x08, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0xb3, 0x01, 0x0a, 0x07, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6c, 0x61, - 0x6e, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x34, 0x0a, 0x05, 0x61, 0x70, 0x70, - 0x6c, 0x79, 0x18, 0x02, 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, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x12, - 0x37, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x6c, 0x6f, + 0x67, 0x69, 0x6e, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x61, 0x64, 0x79, 0x12, 0x43, + 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x1b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x53, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x73, 0x1a, 0x36, 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, 0xb5, 0x02, 0x0a, 0x03, 0x41, 0x70, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, + 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, + 0x06, 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, + 0x07, 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, 0x12, 0x41, 0x0a, 0x0d, + 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, + 0x72, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 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, 0xf1, 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, 0x12, 0x23, 0x0a, 0x0d, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, 0x73, 0x74, 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, 0x82, 0x0a, 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, 0x79, 0x0a, 0x06, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 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, 0x1a, 0xda, 0x01, 0x0a, 0x04, 0x50, 0x6c, 0x61, 0x6e, 0x12, + 0x35, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 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, 0xbb, 0x01, 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, 0x12, 0x3a, - 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, - 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6c, - 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 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, 0x3b, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x53, - 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x4f, - 0x57, 0x4e, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, - 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, - 0x4c, 0x49, 0x43, 0x10, 0x02, 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, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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, 0x53, + 0x0a, 0x15, 0x72, 0x69, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, + 0x72, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x1a, 0x52, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x35, 0x0a, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 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, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x1a, 0x08, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x1a, 0xb3, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, + 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, + 0x12, 0x34, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x02, 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, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, + 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x18, 0x03, 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, 0xbb, 0x01, 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, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x70, 0x6c, 0x61, 0x6e, 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, + 0x3b, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, + 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x02, 0x2a, 0x37, 0x0a, 0x13, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, + 0x52, 0x4f, 0x59, 0x10, 0x02, 0x32, 0xa3, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x05, 0x50, 0x61, 0x72, 0x73, 0x65, 0x12, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x50, 0x0a, 0x09, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, + 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, + 0x72, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/provisionersdk/proto/provisioner.proto b/provisionersdk/proto/provisioner.proto index 7c96ac2bc53e5..888d98c647db9 100644 --- a/provisionersdk/proto/provisioner.proto +++ b/provisionersdk/proto/provisioner.proto @@ -117,7 +117,7 @@ message Agent { int32 connection_timeout_seconds = 11; string troubleshooting_url = 12; string motd_file = 13; - bool delay_login_until_ready = 14; + bool login_before_ready = 14; int32 startup_script_timeout_seconds = 15; } diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index d31a22ce6e35c..62e590c65dc93 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -939,7 +939,7 @@ export interface WorkspaceAgent { readonly latency?: Record readonly connection_timeout_seconds: number readonly troubleshooting_url: string - readonly delay_login_until_ready: boolean + readonly login_before_ready: boolean readonly startup_script_timeout_seconds: number } diff --git a/site/src/components/Resources/AgentStatus.tsx b/site/src/components/Resources/AgentStatus.tsx index 0ab12ffdc95ae..c0c2974462fe9 100644 --- a/site/src/components/Resources/AgentStatus.tsx +++ b/site/src/components/Resources/AgentStatus.tsx @@ -136,31 +136,31 @@ const ConnectedStatus: React.FC<{ agent: WorkspaceAgent }> = ({ agent }) => { // NOTE(mafredri): Keep this behind feature flag for the time-being, - // if delay_login_until_ready is true, the user has updated to - // terraform-provider-coder v0.6.7 and opted in to the functionality. + // if login_before_ready is false, the user has updated to + // terraform-provider-coder v0.6.10 and opted in to the functionality. // // Remove check once documentation is in place and we do a breaking // release indicating startup script behavior has changed. // https://github.com/coder/coder/issues/5749 - if (agent.delay_login_until_ready) { - return ( - - - - - - - - - - - - - - - ) + if (agent.login_before_ready) { + return } - return + return ( + + + + + + + + + + + + + + + ) } const DisconnectedStatus: React.FC = () => { diff --git a/site/src/testHelpers/entities.ts b/site/src/testHelpers/entities.ts index 526a91cec08d1..f8fac52b98604 100644 --- a/site/src/testHelpers/entities.ts +++ b/site/src/testHelpers/entities.ts @@ -309,7 +309,7 @@ export const MockWorkspaceAgent: TypesGen.WorkspaceAgent = { connection_timeout_seconds: 120, troubleshooting_url: "https://coder.com/troubleshoot", lifecycle_state: "starting", - delay_login_until_ready: true, + login_before_ready: false, startup_script_timeout_seconds: 120, } From 4d5b065f0caecf446973b9043cbe8169f0e9034d Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 17:44:01 +0000 Subject: [PATCH 02/11] fixup! chore: Invert `delay_login_until_ready`, now `login_before_ready` --- cli/ssh.go | 2 +- cli/testdata/coder_ssh_--help.golden | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/ssh.go b/cli/ssh.go index 6f8aaf7854832..bd9f18eb031a7 100644 --- a/cli/ssh.go +++ b/cli/ssh.go @@ -250,7 +250,7 @@ func ssh() *cobra.Command { cliflag.BoolVarP(cmd.Flags(), &forwardGPG, "forward-gpg", "G", "CODER_SSH_FORWARD_GPG", false, "Specifies whether to forward the GPG agent. Unsupported on Windows workspaces, but supports all clients. Requires gnupg (gpg, gpgconf) on both the client and workspace. The GPG agent must already be running locally and will not be started for you. If a GPG agent is already running in the workspace, it will be attempted to be killed.") cliflag.StringVarP(cmd.Flags(), &identityAgent, "identity-agent", "", "CODER_SSH_IDENTITY_AGENT", "", "Specifies which identity agent to use (overrides $SSH_AUTH_SOCK), forward agent must also be enabled") cliflag.DurationVarP(cmd.Flags(), &wsPollInterval, "workspace-poll-interval", "", "CODER_WORKSPACE_POLL_INTERVAL", workspacePollInterval, "Specifies how often to poll for workspace automated shutdown.") - cliflag.BoolVarP(cmd.Flags(), &noWait, "no-wait", "", "CODER_SSH_NO_WAIT", false, "Specifies whether to wait for a workspace to become ready before logging in (only applicable when the delay login until ready option is enabled). Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state.") + cliflag.BoolVarP(cmd.Flags(), &noWait, "no-wait", "", "CODER_SSH_NO_WAIT", false, "Specifies whether to wait for a workspace to become ready before logging in (only applicable when the login before ready option has not been enabled). Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state.") return cmd } diff --git a/cli/testdata/coder_ssh_--help.golden b/cli/testdata/coder_ssh_--help.golden index b539c1a76b34a..4a716fa5eda62 100644 --- a/cli/testdata/coder_ssh_--help.golden +++ b/cli/testdata/coder_ssh_--help.golden @@ -22,8 +22,8 @@ Flags: Consumes $CODER_SSH_IDENTITY_AGENT --no-wait Specifies whether to wait for a workspace to become ready before logging in (only applicable when the - delay login until ready option is enabled). Note - that the workspace agent may still be in the + login before ready option has not been enabled). + Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state. Consumes $CODER_SSH_NO_WAIT From e27812c5e725f7e5b12f178e443e724f92fdfd0d Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 17:52:35 +0000 Subject: [PATCH 03/11] fixup! chore: Invert `delay_login_until_ready`, now `login_before_ready` --- cli/cliui/agent_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/cliui/agent_test.go b/cli/cliui/agent_test.go index 435cbac0d8a8e..5122baaa755a1 100644 --- a/cli/cliui/agent_test.go +++ b/cli/cliui/agent_test.go @@ -30,7 +30,8 @@ func TestAgent(t *testing.T) { WorkspaceName: "example", Fetch: func(_ context.Context) (codersdk.WorkspaceAgent, error) { agent := codersdk.WorkspaceAgent{ - Status: codersdk.WorkspaceAgentDisconnected, + Status: codersdk.WorkspaceAgentDisconnected, + LoginBeforeReady: true, } if disconnected.Load() { agent.Status = codersdk.WorkspaceAgentConnected @@ -73,6 +74,7 @@ func TestAgent_TimeoutWithTroubleshootingURL(t *testing.T) { agent := codersdk.WorkspaceAgent{ Status: codersdk.WorkspaceAgentConnecting, TroubleshootingURL: wantURL, + LoginBeforeReady: true, } switch { case !connected.Load() && timeout.Load(): From ebf8a0d13071759a57595d819334d07b57189e67 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 18:08:05 +0000 Subject: [PATCH 04/11] Add lifecycle states to tests --- cli/cliui/resources_test.go | 4 ++++ cmd/cliui/main.go | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/cliui/resources_test.go b/cli/cliui/resources_test.go index f5018dfcb4126..59d5120a66291 100644 --- a/cli/cliui/resources_test.go +++ b/cli/cliui/resources_test.go @@ -26,6 +26,7 @@ func TestWorkspaceResources(t *testing.T) { Agents: []codersdk.WorkspaceAgent{{ Name: "dev", Status: codersdk.WorkspaceAgentConnected, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, Architecture: "amd64", OperatingSystem: "linux", }}, @@ -60,6 +61,7 @@ func TestWorkspaceResources(t *testing.T) { Agents: []codersdk.WorkspaceAgent{{ CreatedAt: database.Now().Add(-10 * time.Second), Status: codersdk.WorkspaceAgentConnecting, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, Name: "dev", OperatingSystem: "linux", Architecture: "amd64", @@ -70,12 +72,14 @@ func TestWorkspaceResources(t *testing.T) { Name: "dev", Agents: []codersdk.WorkspaceAgent{{ Status: codersdk.WorkspaceAgentConnected, + LifecycleState: codersdk.WorkspaceAgentLifecycleReady, Name: "go", Architecture: "amd64", OperatingSystem: "linux", }, { DisconnectedAt: &disconnected, Status: codersdk.WorkspaceAgentDisconnected, + LifecycleState: codersdk.WorkspaceAgentLifecycleReady, Name: "postgres", Architecture: "amd64", OperatingSystem: "linux", diff --git a/cmd/cliui/main.go b/cmd/cliui/main.go index 7fef956fa7693..b7a8e004ce31d 100644 --- a/cmd/cliui/main.go +++ b/cmd/cliui/main.go @@ -163,7 +163,8 @@ func main() { Use: "agent", RunE: func(cmd *cobra.Command, args []string) error { agent := codersdk.WorkspaceAgent{ - Status: codersdk.WorkspaceAgentDisconnected, + Status: codersdk.WorkspaceAgentDisconnected, + LifecycleState: codersdk.WorkspaceAgentLifecycleReady, } go func() { time.Sleep(3 * time.Second) @@ -203,6 +204,7 @@ func main() { Agents: []codersdk.WorkspaceAgent{{ CreatedAt: database.Now().Add(-10 * time.Second), Status: codersdk.WorkspaceAgentConnecting, + LifecycleState: codersdk.WorkspaceAgentLifecycleCreated, Name: "dev", OperatingSystem: "linux", Architecture: "amd64", @@ -213,12 +215,14 @@ func main() { Name: "dev", Agents: []codersdk.WorkspaceAgent{{ Status: codersdk.WorkspaceAgentConnected, + LifecycleState: codersdk.WorkspaceAgentLifecycleReady, Name: "go", Architecture: "amd64", OperatingSystem: "linux", }, { DisconnectedAt: &disconnected, Status: codersdk.WorkspaceAgentDisconnected, + LifecycleState: codersdk.WorkspaceAgentLifecycleReady, Name: "postgres", Architecture: "amd64", OperatingSystem: "linux", From 4937ba01094d3a20db16b5d66892ae128526df52 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 18:31:49 +0000 Subject: [PATCH 05/11] Fix spinner --- cli/cliui/agent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cliui/agent.go b/cli/cliui/agent.go index f4ff03a606c8c..bfa717c03de18 100644 --- a/cli/cliui/agent.go +++ b/cli/cliui/agent.go @@ -176,7 +176,7 @@ func waitingMessage(agent codersdk.WorkspaceAgent, opts AgentOptions) (m *messag Prompt: "Don't panic, your workspace is booting up!", } defer func() { - if opts.NoWait { + if agent.Status == codersdk.WorkspaceAgentConnected && opts.NoWait { m.Spin = "" } if m.Spin != "" { From d9fb8c6a1a6402d4eda6eff71e6856ff107424b7 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 19:07:48 +0000 Subject: [PATCH 06/11] Fix clidocgen --- Makefile | 2 +- docs/cli/coder_ssh.md | 2 +- scripts/clidocgen/main.go | 32 ++++++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 32ad63fcc8cb7..035a47351fadd 100644 --- a/Makefile +++ b/Makefile @@ -494,7 +494,7 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me cd site yarn run format:write:only ../docs/admin/prometheus.md -docs/cli/coder.md: scripts/clidocgen/main.go $(shell find ./cli/ -type f) +docs/cli/coder.md: scripts/clidocgen/main.go $(GO_SRC_FILES) BASE_PATH="." go run scripts/clidocgen/main.go cd site yarn run format:write:only ../docs/cli/**.md diff --git a/docs/cli/coder_ssh.md b/docs/cli/coder_ssh.md index b75f363add193..5beadca2ae2b3 100644 --- a/docs/cli/coder_ssh.md +++ b/docs/cli/coder_ssh.md @@ -16,7 +16,7 @@ coder ssh [flags] -h, --help help for ssh --identity-agent string Specifies which identity agent to use (overrides $SSH_AUTH_SOCK), forward agent must also be enabled. Consumes $CODER_SSH_IDENTITY_AGENT - --no-wait Specifies whether to wait for a workspace to become ready before logging in (only applicable when the delay login until ready option is enabled). Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state. + --no-wait Specifies whether to wait for a workspace to become ready before logging in (only applicable when the login before ready option has not been enabled). Note that the workspace agent may still be in the process of executing the startup script and the workspace may be in an incomplete state. Consumes $CODER_SSH_NO_WAIT --stdio Specifies whether to emit SSH output over stdin/stdout. Consumes $CODER_SSH_STDIO diff --git a/scripts/clidocgen/main.go b/scripts/clidocgen/main.go index efae448337f21..422a19aec126e 100644 --- a/scripts/clidocgen/main.go +++ b/scripts/clidocgen/main.go @@ -4,6 +4,7 @@ import ( "encoding/json" "log" "os" + "os/user" "path" "regexp" "strings" @@ -29,14 +30,26 @@ type manifest struct { } func main() { - // Set default configs for the docs - err := os.Setenv("CODER_CONFIG_DIR", "~/.config/coderv2") - if err != nil { - log.Fatal("Unable to set default value for CODER_CONFIG_DIR: ", err) + for _, env := range os.Environ() { + if strings.HasPrefix(env, "CODER_") { + split := strings.SplitN(env, "=", 2) + if err := os.Unsetenv(split[0]); err != nil { + log.Fatal("Unable to unset ", split[0], ": ", err) + } + } + } + for k, v := range map[string]string{ + "CODER_CONFIG_DIR": "~/.config/coderv2", + "CODER_CACHE_DIRECTORY": "~/.cache/coder", + } { + if err := os.Setenv(k, v); err != nil { + log.Fatal("Unable to set default value for ", k, ": ", err) + } } - err = os.Setenv("CODER_CACHE_DIRECTORY", "~/.cache/coder") + + u, err := user.Current() if err != nil { - log.Fatal("Unable to set default value for CODER_CACHE_DIRECTORY: ", err) + log.Fatal("Error on getting the current user: ", err) } // Get the cmd CLI @@ -97,7 +110,10 @@ func main() { } content = strings.ReplaceAll(content, dir, "") - err = os.WriteFile(filepath, []byte(content), 0644) // #nosec + // Remove all absolute home paths. + content = strings.ReplaceAll(content, u.HomeDir, "~") + + err = os.WriteFile(filepath, []byte(content), 0o644) // #nosec if err != nil { log.Fatal("Error on save file at ", filepath, ": ", err) } @@ -127,7 +143,7 @@ func main() { if err != nil { log.Fatal("Error on marshal manifest.json: ", err) } - err = os.WriteFile(manifestFilepath, manifestFile, 0644) // #nosec + err = os.WriteFile(manifestFilepath, manifestFile, 0o644) // #nosec if err != nil { log.Fatal("Error on write update on manifest.json: ", err) } From 724fdf4e6a92cd92cff63d2bc025a024c80eb079 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 19:23:24 +0000 Subject: [PATCH 07/11] Fix clidocgen^2 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 035a47351fadd..a43ef6e4496b6 100644 --- a/Makefile +++ b/Makefile @@ -494,10 +494,10 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me cd site yarn run format:write:only ../docs/admin/prometheus.md -docs/cli/coder.md: scripts/clidocgen/main.go $(GO_SRC_FILES) +docs/cli/coder.md: scripts/clidocgen/main.go $(GO_SRC_FILES) docs/manifest.json BASE_PATH="." go run scripts/clidocgen/main.go cd site - yarn run format:write:only ../docs/cli/**.md + yarn run format:write:only ../docs/cli/*.md ../docs/manifest.json docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go go run scripts/auditdocgen/main.go From b0d09fc0cdc36faa6e0036eb6062a6e86d44cf66 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 19:33:47 +0000 Subject: [PATCH 08/11] Fix default value for login before ready from tf --- provisioner/terraform/resources.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index 9dc4e770bc519..2de4162d35bf6 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -123,6 +123,12 @@ func ConvertResourcesAndParameters(modules []*tfjson.StateModule, rawGraph strin } agentNames[tfResource.Name] = struct{}{} + // Handling for provider pre-v0.6.10. + loginBeforeReady := true + if _, ok := tfResource.AttributeValues["login_before_ready"]; ok { + loginBeforeReady = attrs.LoginBeforeReady + } + agent := &proto.Agent{ Name: tfResource.Name, Id: attrs.ID, @@ -134,7 +140,7 @@ func ConvertResourcesAndParameters(modules []*tfjson.StateModule, rawGraph strin ConnectionTimeoutSeconds: attrs.ConnectionTimeoutSeconds, TroubleshootingUrl: attrs.TroubleshootingURL, MotdFile: attrs.MOTDFile, - LoginBeforeReady: attrs.LoginBeforeReady, + LoginBeforeReady: loginBeforeReady, StartupScriptTimeoutSeconds: attrs.StartupScriptTimeoutSeconds, } switch attrs.Auth { From d903d7821e072017220e0d29dd023904a53d6bae Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 19:40:59 +0000 Subject: [PATCH 09/11] Test From 2f4bbf73fa86de1c7005a8dd07763ac43bab3a84 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 19:47:45 +0000 Subject: [PATCH 10/11] Fix tests --- provisioner/terraform/resources_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index eb62894e8778b..873a655212062 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -41,6 +41,7 @@ func TestConvertResources(t *testing.T) { OperatingSystem: "linux", Architecture: "amd64", Auth: &proto.Agent_Token{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }}, @@ -57,6 +58,7 @@ func TestConvertResources(t *testing.T) { OperatingSystem: "linux", Architecture: "amd64", Auth: &proto.Agent_Token{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }, { @@ -89,6 +91,7 @@ func TestConvertResources(t *testing.T) { OperatingSystem: "linux", Architecture: "amd64", Auth: &proto.Agent_Token{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }}, @@ -161,6 +164,7 @@ func TestConvertResources(t *testing.T) { }, }, Auth: &proto.Agent_Token{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }}, @@ -234,6 +238,7 @@ func TestConvertResources(t *testing.T) { }, }, Auth: &proto.Agent_Token{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }, @@ -248,6 +253,7 @@ func TestConvertResources(t *testing.T) { OperatingSystem: "windows", Architecture: "arm64", Auth: &proto.Agent_Token{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }}, From 5db806f5c92dfe0e6a31beca092dec028f84b19b Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 27 Jan 2023 19:51:17 +0000 Subject: [PATCH 11/11] fixup! Fix tests --- provisioner/terraform/resources_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index 873a655212062..36ca43811bc02 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -76,6 +76,7 @@ func TestConvertResources(t *testing.T) { OperatingSystem: "linux", Architecture: "amd64", Auth: &proto.Agent_InstanceId{}, + LoginBeforeReady: true, ConnectionTimeoutSeconds: 120, }}, }},