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

Commitb94b7ea

Browse files
authored
fix(provider): coalesce arch to armv7 if on 32-bit arm (#210)
This PR modifies the `coder_provisioner` datasource to return `arch` as `armv7` if `GOARCH=arm`.This fixes an issue where users on 32-bit arm platforms would be unable to create a template with```resource "coder_agent" "main" { arch = data.coder_provisioner.me.arch ...}```and would instead need to manually specify```resource "coder_agent" "main" { arch = "armv7" ...}```
1 parentf3a205c commitb94b7ea

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

‎docs/resources/agent_instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
page_title:"coder_agent_instance Resource - terraform-provider-coder"
44
subcategory:""
55
description:|-
6-
Use this resource to associate an instance ID with an agent for zero-trust authentication. This association is done automatically for "googlecomputeinstance", "awsinstance", "azurermlinuxvirtualmachine", and "azurermwindowsvirtual_machine" resources.
6+
Use this resource to associate an instance ID with an agent for zero-trust authentication. This association is done automatically for "google_compute_instance", "aws_instance", "azurerm_linux_virtual_machine", and "azurerm_windows_virtual_machine" resources.
77
---
88

99
#coder_agent_instance (Resource)

‎provider/provisioner.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ func provisionerDataSource() *schema.Resource {
1616
rd.SetId(uuid.NewString())
1717
rd.Set("os",runtime.GOOS)
1818
rd.Set("arch",runtime.GOARCH)
19+
// Fix for #11782: if we're on 32-bit ARM, set arch to armv7.
20+
ifruntime.GOARCH=="arm" {
21+
rd.Set("arch","armv7")
22+
}
1923

2024
returnnil
2125
},

‎provider/provisioner_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ func TestProvisioner(t *testing.T) {
3131

3232
attribs:=resource.Primary.Attributes
3333
require.Equal(t,runtime.GOOS,attribs["os"])
34-
require.Equal(t,runtime.GOARCH,attribs["arch"])
34+
ifruntime.GOARCH=="arm" {
35+
require.Equal(t,"armv7",attribs["arch"])
36+
}else {
37+
require.Equal(t,runtime.GOARCH,attribs["arch"])
38+
}
3539
returnnil
3640
},
3741
}},
3842
})
3943
}
44+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp