Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit578eb11

Browse files
committed
Update Terraform provider to use relative path
1 parente3ff8ad commit578eb11

File tree

15 files changed

+216
-187
lines changed

15 files changed

+216
-187
lines changed

‎coderd/coderd.go‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ import (
3434

3535
// Options are requires parameters for Coder to start.
3636
typeOptionsstruct {
37-
AccessURL*url.URL
38-
Logger slog.Logger
39-
Database database.Store
40-
Pubsub database.Pubsub
37+
AccessURL*url.URL
38+
WildcardURL*url.URL
39+
Logger slog.Logger
40+
Database database.Store
41+
Pubsub database.Pubsub
4142

4243
AgentConnectionUpdateFrequency time.Duration
4344
// APIRateLimit is the minutely throughput rate limit per user or ip.

‎coderd/database/databasefake/databasefake.go‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,13 +1533,14 @@ func (q *fakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW
15331533
deferq.mutex.Unlock()
15341534

15351535
workspaceApp:= database.WorkspaceApp{
1536-
ID:arg.ID,
1537-
AgentID:arg.AgentID,
1538-
CreatedAt:arg.CreatedAt,
1539-
Name:arg.Name,
1540-
Icon:arg.Icon,
1541-
Command:arg.Command,
1542-
Target:arg.Target,
1536+
ID:arg.ID,
1537+
AgentID:arg.AgentID,
1538+
CreatedAt:arg.CreatedAt,
1539+
Name:arg.Name,
1540+
Icon:arg.Icon,
1541+
Command:arg.Command,
1542+
Url:arg.Url,
1543+
RelativePath:arg.RelativePath,
15431544
}
15441545
q.workspaceApps=append(q.workspaceApps,workspaceApp)
15451546
returnworkspaceApp,nil

‎coderd/database/dump.sql‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
File renamed without changes.

‎coderd/database/migrations/000011_workspace_apps.up.sql‎renamed to ‎coderd/database/migrations/000014_workspace_apps.up.sql‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ CREATE TABLE workspace_apps (
44
agent_id uuidNOT NULLREFERENCES workspace_agents (id)ON DELETE CASCADE,
55
namevarchar(64)NOT NULL,
66
iconvarchar(256)NOT NULL,
7-
-- A command to run when opened.
87
commandvarchar(65534),
9-
-- A URL or port to target.
10-
targetvarchar(65534),
8+
urlvarchar(65534),
9+
relative_pathbooleanNOT NULL DEFAULT false,
1110
PRIMARY KEY (id),
1211
UNIQUE(agent_id, name)
1312
);

‎coderd/database/models.go‎

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries.sql.go‎

Lines changed: 21 additions & 15 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/workspaceapps.sql‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ INSERT INTO
1313
name,
1414
icon,
1515
command,
16-
target
16+
url,
17+
relative_path
1718
)
1819
VALUES
19-
($1, $2, $3, $4, $5, $6, $7) RETURNING*;
20+
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING*;

‎coderd/provisionerdaemons.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,11 @@ func insertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid.
665665
String:app.Command,
666666
Valid:app.Command!="",
667667
},
668-
Target: sql.NullString{
669-
String:app.Target,
670-
Valid:app.Target!="",
668+
Url: sql.NullString{
669+
String:app.Url,
670+
Valid:app.Url!="",
671671
},
672+
RelativePath:app.RelativePath,
672673
})
673674
iferr!=nil {
674675
returnxerrors.Errorf("insert app: %w",err)

‎coderd/workspaceagents.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,11 @@ func convertApps(dbApps []database.WorkspaceApp) []codersdk.WorkspaceApp {
462462
apps:=make([]codersdk.WorkspaceApp,0)
463463
for_,dbApp:=rangedbApps {
464464
apps=append(apps, codersdk.WorkspaceApp{
465-
ID:dbApp.ID,
466-
Name:dbApp.Name,
467-
Command:dbApp.Command.String,
468-
Target:dbApp.Target.String,
469-
Icon:dbApp.Icon,
465+
ID:dbApp.ID,
466+
Name:dbApp.Name,
467+
Command:dbApp.Command.String,
468+
AccessURL:dbApp.Url.String,
469+
Icon:dbApp.Icon,
470470
})
471471
}
472472
returnapps

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp