File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ func provisionerDataSource() *schema.Resource {
16
16
rd .SetId (uuid .NewString ())
17
17
rd .Set ("os" , runtime .GOOS )
18
18
rd .Set ("arch" , runtime .GOARCH )
19
+ // Fix for #11782: if we're on 32-bit ARM, set arch to armv7.
20
+ if runtime .GOARCH == "arm" {
21
+ rd .Set ("arch" , "armv7" )
22
+ }
19
23
20
24
return nil
21
25
},
Original file line number Diff line number Diff line change @@ -37,3 +37,34 @@ func TestProvisioner(t *testing.T) {
37
37
}},
38
38
})
39
39
}
40
+
41
+ func TestProvisioner_ARMv7 (t * testing.T ) {
42
+ if runtime .GOARCH != "arm" {
43
+ t .Skip ("This test can only run on 32-bit ARM architecture" )
44
+ }
45
+ resource .Test (t , resource.TestCase {
46
+ Providers : map [string ]* schema.Provider {
47
+ "coder" : provider .New (),
48
+ },
49
+ IsUnitTest : true ,
50
+ Steps : []resource.TestStep {{
51
+ Config : `
52
+ provider "coder" {
53
+ }
54
+ data "coder_provisioner" "me" {
55
+ }` ,
56
+ Check : func (state * terraform.State ) error {
57
+ require .Len (t , state .Modules , 1 )
58
+ require .Len (t , state .Modules [0 ].Resources , 1 )
59
+ resource := state .Modules [0 ].Resources ["data.coder_provisioner.me" ]
60
+ require .NotNil (t , resource )
61
+
62
+ attribs := resource .Primary .Attributes
63
+ require .Equal (t , runtime .GOOS , attribs ["os" ])
64
+ require .Equal (t , "armv7" , attribs ["arch" ])
65
+ return nil
66
+ },
67
+ }},
68
+ })
69
+
70
+ }
You can’t perform that action at this time.
0 commit comments