Skip to content

Commit 1b38a5e

Browse files
committed
examples/ssh: Sync version
1 parent 4d7d949 commit 1b38a5e

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Set up Go
1818
uses: actions/setup-go@v2
1919
with:
20-
go-version: 1.14
20+
go-version: 1.17
2121
-
2222
name: Import GPG key
2323
id: import_gpg

examples/sshd/providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
terraform {
22
required_providers {
33
linuxkit = {
4-
source = "terraform.resinstack.io/resinstack/linuxkit"
5-
version = "~> 1.0"
4+
source = "resinstack/linuxkit"
5+
version = "0.0.4"
66
}
77
}
88
}

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ require (
88
github.com/gofrs/uuid v3.3.0+incompatible // indirect
99
github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.3
1010
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
11-
github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20220101224656-b5bf29c0f64a
11+
github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20220110180034-5b7466732a90
1212
github.com/mitchellh/go-homedir v1.1.0
1313
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
1414
github.com/pkg/errors v0.9.1
1515
github.com/xeipuuv/gojsonschema v0.0.0-20180816142147-da425ebb7609 // indirect
1616
github.com/zclconf/go-cty v1.4.1 // indirect
1717
gopkg.in/yaml.v2 v2.4.0
1818
)
19-
20-
replace github.com/linuxkit/linuxkit/src/cmd/linuxkit => ../../linuxkit/linuxkit/src/cmd/linuxkit

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
656656
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
657657
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
658658
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
659-
github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20220101224656-b5bf29c0f64a h1:6R5veivLe9PxvKmDEShjP70hYg1xHfQX/B/p8Xl9ts4=
660-
github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20220101224656-b5bf29c0f64a/go.mod h1:zsOmfchTlI3Ai0pxUrSaHv6yxZdSUQF6ffSJlwier2k=
659+
github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20220110180034-5b7466732a90 h1:+ot68CMAIQmUDFufoLoOLKlOtdybZSqMsSPRP3voAIs=
660+
github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20220110180034-5b7466732a90/go.mod h1:zsOmfchTlI3Ai0pxUrSaHv6yxZdSUQF6ffSJlwier2k=
661661
github.com/linuxkit/virtsock v0.0.0-20180830132707-8e79449dea07/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
662662
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
663663
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=

linuxkit/data_source_config.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package linuxkit
22

33
import (
44
"errors"
5-
"runtime"
65

76
"gopkg.in/yaml.v2"
87

@@ -57,12 +56,6 @@ func withConfigSchema(s map[string]*schema.Schema) {
5756
ForceNew: true,
5857
Elem: &schema.Schema{Type: schema.TypeString},
5958
}
60-
s["architecture"] = &schema.Schema{
61-
Type: schema.TypeString,
62-
Description: "Architecture to build for",
63-
Optional: true,
64-
ForceNew: true,
65-
}
6659
}
6760

6861
func fromConfigSchema(d *schema.ResourceData) (*moby.Moby, []byte, error) {
@@ -126,12 +119,6 @@ func fromConfigSchema(d *schema.ResourceData) (*moby.Moby, []byte, error) {
126119
}
127120
}
128121

129-
if v, ok := d.GetOk("architecture"); ok {
130-
config.Architecture = v.(string)
131-
} else {
132-
config.Architecture = runtime.GOARCH
133-
}
134-
135122
byts, err := yaml.Marshal(config)
136123
if err != nil {
137124
return nil, nil, err

linuxkit/resource_build.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io"
77
"os"
8+
"runtime"
89

910
"gopkg.in/yaml.v2"
1011

@@ -52,6 +53,12 @@ func buildResource() *schema.Resource {
5253
Description: "Type of build, can be tar or docker",
5354
Optional: true,
5455
},
56+
"architecture": &schema.Schema{
57+
Type: schema.TypeString,
58+
Default: runtime.GOARCH,
59+
Description: "Architecture to build for, defaults to host",
60+
Optional: true,
61+
},
5562
},
5663
}
5764

@@ -104,7 +111,7 @@ func buildCreate(d *schema.ResourceData, meta interface{}) error {
104111

105112
cacheDir := defaultLinuxkitCache()
106113

107-
err = moby.Build(config, outputFile, false, typ, false, cacheDir, false)
114+
err = moby.Build(config, outputFile, false, typ, false, cacheDir, false, d.Get("architecture").(string))
108115
if err != nil {
109116
return err
110117
}

0 commit comments

Comments
 (0)