Skip to content

Commit c4f1676

Browse files
authored
feat: expose workspace build ID to terraform-plugin-coder (#13680)
1 parent 30c4b4d commit c4f1676

File tree

6 files changed

+155
-136
lines changed

6 files changed

+155
-136
lines changed

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo
598598
WorkspaceOwnerSessionToken: sessionToken,
599599
WorkspaceOwnerSshPublicKey: ownerSSHPublicKey,
600600
WorkspaceOwnerSshPrivateKey: ownerSSHPrivateKey,
601+
WorkspaceBuildId: workspaceBuild.ID.String(),
601602
},
602603
LogLevel: input.LogLevel,
603604
},

coderd/provisionerdserver/provisionerdserver_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ func TestAcquireJob(t *testing.T) {
365365
WorkspaceOwnerSessionToken: sessionToken,
366366
WorkspaceOwnerSshPublicKey: sshKey.PublicKey,
367367
WorkspaceOwnerSshPrivateKey: sshKey.PrivateKey,
368+
WorkspaceBuildId: build.ID.String(),
368369
},
369370
},
370371
})

provisioner/terraform/provision.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ func provisionEnv(
210210
"CODER_WORKSPACE_TEMPLATE_ID="+metadata.GetTemplateId(),
211211
"CODER_WORKSPACE_TEMPLATE_NAME="+metadata.GetTemplateName(),
212212
"CODER_WORKSPACE_TEMPLATE_VERSION="+metadata.GetTemplateVersion(),
213+
"CODER_WORKSPACE_BUILD_ID="+metadata.GetWorkspaceBuildId(),
213214
)
214215
for key, value := range provisionersdk.AgentScriptEnv() {
215216
env = append(env, key+"="+value)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy