Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 235ecc8

Browse files
committed
Pass workspace owner email address to provisioner
1 parent a66b852 commit 235ecc8

File tree

4 files changed

+92
-63
lines changed

4 files changed

+92
-63
lines changed

coderd/provisionerdaemons.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ func (server *provisionerdServer) AcquireJob(ctx context.Context, _ *proto.Empty
256256
WorkspaceTransition: transition,
257257
WorkspaceName: workspace.Name,
258258
WorkspaceOwner: owner.Username,
259+
// We don't currently know any "name" for a user aside from their username,
260+
// but when we do, we should set the WorkspaceOwnerName field here too.
261+
WorkspaceOwnerEmail: owner.Email,
259262
WorkspaceId: workspace.ID.String(),
260263
WorkspaceOwnerId: owner.ID.String(),
261264
},

provisioner/terraform/provision.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ func provisionEnv(start *proto.Provision_Start) ([]string, error) {
162162
"CODER_WORKSPACE_TRANSITION="+strings.ToLower(start.Metadata.WorkspaceTransition.String()),
163163
"CODER_WORKSPACE_NAME="+start.Metadata.WorkspaceName,
164164
"CODER_WORKSPACE_OWNER="+start.Metadata.WorkspaceOwner,
165+
"CODER_WORKSPACE_OWNER_NAME="+start.Metadata.WorkspaceOwnerName,
166+
"CODER_WORKSPACE_OWNER_EMAIL="+start.Metadata.WorkspaceOwnerEmail,
165167
"CODER_WORKSPACE_ID="+start.Metadata.WorkspaceId,
166168
"CODER_WORKSPACE_OWNER_ID="+start.Metadata.WorkspaceOwnerId,
167169
)

provisionersdk/proto/provisioner.pb.go

Lines changed: 84 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

provisionersdk/proto/provisioner.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ message Provision {
134134
string workspace_owner = 4;
135135
string workspace_id = 5;
136136
string workspace_owner_id = 6;
137+
string workspace_owner_name = 7;
138+
string workspace_owner_email = 8;
137139
}
138140
message Start {
139141
string directory = 1;
@@ -150,7 +152,7 @@ message Provision {
150152
}
151153
}
152154
message Complete {
153-
bytes state = 1;
155+
bytes state = 1;
154156
string error = 2;
155157
repeated Resource resources = 3;
156158
}

0 commit comments

Comments
 (0)